LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1D Array to String with no EOL

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
(2,384 Views)

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

Message 2 of 9
(2,375 Views)

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
(2,367 Views)

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
(2,349 Views)

@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
(2,342 Views)

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
(2,334 Views)

@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
(2,333 Views)

Old school solution. 🙂

Array to string.png

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 9
(2,300 Views)

@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
(2,285 Views)