LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

formatting a large number of strings....?

I'm recording a lot of data, the text file has over 100 columns. And the way I know how to format everything is way too tedious for this amount of columns.

 

For example, if I want to initially create the file with the column names, I do this:

step 1.PNG

 

After that, I'd have a VI in a loop that is continuously formatting all the values into a string and writing to the file

step 2.PNG

 

Easy enough. But when I've got 100+ columns this gets "messy". Very prone to errors, I can easily forget a format specifier, etc.

 

Is there a better way to do this? I mean, I feel like my manual way is insanity.

0 Kudos
Message 1 of 4
(790 Views)

Hi David,

 

what about ArrayToSpreadsheetString?

 

Generic suggestions:

  • Whatever you do with lots of controls could be done with an array of controls.
  • With an array you could use a FOR loop to autoindex the elements - or use a function which is made to handle arrays…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(788 Views)

I was also going to suggest the Array To Spreadsheet String.  It allows you to choose the delimiter and the format for all items.


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
Message 3 of 4
(781 Views)

Thanks guys, I will give this a go

0 Kudos
Message 4 of 4
(777 Views)