LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1D Array to String with no EOL

Highlighted

Something that often irritates me is if I am trying to convert a 1D array to spreadsheet string but without the EOL character.

 

I always end up having to manually remove the EOL character afterwards which is a waste of BD space.

 

Surely there is an easier way of doing this that I have never thought of?

1D array to string.png

 

Edit. Also, I know about the 1D string array to delimited string function, but this requires me to convert my numeric to an array of strings first. The number to string primitives do accept arrays by I cannot work out a way of converting them to an auto formatted string with no trailing zeros as the code above does.

 

0 Kudos
Message 1 of 9
(247 Views)
Highlighted

There is a "trim whitespace" function that you can use after the "array to spreadsheet string".

Message 2 of 9
(238 Views)
Highlighted

Step in the right direction, thanks. I haven't used that before and assumed it only removed spaces not other things as well.

0 Kudos
Message 3 of 9
(230 Views)
Highlighted

You're not alone: See the idea Row-Separator-Input-for-Array-to-Spreadsheet-String-Function.

 

That idea will fix your problem too...

0 Kudos
Message 4 of 9
(212 Views)
Highlighted

@Niatross wrote:

Edit. Also, I know about the 1D string array to delimited string function, but this requires me to convert my numeric to an array of strings first.


And have you looked inside of that VI?

 

I also just use the Trim Whitespace.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 9
(205 Views)
Highlighted

I hadn't looked inside it, I should have. More robust than what I do as one of my qualms was that the EOL size would be different on different OS's.

 

I was just hoping that I had missed something simple with the array to spreadsheet string function...clearly not

0 Kudos
Message 6 of 9
(197 Views)
Highlighted

@Niatross wrote:

Edit. Also, I know about the 1D string array to delimited string function, but this requires me to convert my numeric to an array of strings first. The number to string primitives do accept arrays by I cannot work out a way of converting them to an auto formatted string with no trailing zeros as the code above does.


Save a copy of that VI as .vim, then it will accept everything (literally) as input. It will break if you wire incorrect inputs... Not as good as a function, but as good as it gets at the moment. 

0 Kudos
Message 7 of 9
(196 Views)
Highlighted

Old school solution. 🙂

Array to string.png

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
Message 8 of 9
(163 Views)
Highlighted

@Yamaeda wrote:

Old school solution. 🙂

Array to string.png


Last time I checked, even the fastest DIY substitute was at least 100X slower.

 

LabVIEW got significantly better over the past few years, so maybe it's not that dramatic anymore.

 

Mine would look like this:

Array To String.png

Message 9 of 9
(148 Views)