LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write 2D Array of string in a text file

Solved!
Go to solution

Hello,

 

I want to write a 2D Array of sting in a text file with good alignment, kann someone help?

 

 

I will attach the 2D array of string and the wrong text file.

 

Best regard

 

Download All
0 Kudos
Message 1 of 7
(4,416 Views)

Hi LLX,

 

open your text document with Excel (or any other tool working with spreadsheets) and everything looks fine!

 As I already told you here it all depends on the tool for viewing your text document!

 Btw.:

- What's wrong with your text file? All data is written to the text file as expected…

- Define a "good formatting" when you you need one…

 

A workaround suitable for your example text: write those numbers using a format string of "%#.6f"…

A possible solution is to use multiple spaces between your numbers - but then you (might) get problems when loading your text files with Excel…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(4,411 Views)

Hello GerdW,

 

Thanks for your reply, but I must use the text editor to open and save the file.

 

Best regard

0 Kudos
Message 3 of 7
(4,401 Views)
Solution
Accepted by topic author TUDarmstadtLLX

Hi LLX,

 

when you are restricted to use the simple notepad you need to use spaces instead of tabs to separate your data columns! Use format strings like "%16s"…

Best regards,
GerdW


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

Hi GerdW,

 

thanks a lot. Amazing Solution. In this project I must always deal with the format of the string, do you know if there is a tutoriums that deal with the string formatting.

 

Best regard

0 Kudos
Message 5 of 7
(4,388 Views)

Hi LLX,

 

reading the LabVIEW help (RTFM!) might be helpful… 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(4,381 Views)

Right GerdW 🙂

0 Kudos
Message 7 of 7
(3,233 Views)