LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

txt file

Solved!
Go to solution

Hello everybody,

I have created a txt file with the function "write in file" how can i introduce a line between the different values that i am saving ?

Example i have this : 0,43240,455660,876666

and i want to have : 0,4324

                                0,455660

                                0,876666

Thank you for your help !

 

Bonjour à tous,

J'ai créé un fichier texte avec la fonction "écrire dans un fichier texte" et j'enregistre des valeurs de positions mais je voudrai aller à la ligne entre toutes mes valeurs comment puis je faire ?

Exemple : j'ai ceci : 0,43240,455660,876666

et je souhaite :

                                0,4324

                                0,455660

                                0,876666

Merci pour votre aide !

0 Kudos
Message 1 of 8
(3,548 Views)

Use LineFeed (or CarriageReturn) instead of TAB, SPACE or comma!

Or create a 2D array consisting of 1 column per row instead of just one row.

 

Both answers may apply to your code - but you haven't shown that…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,541 Views)
Solution
Accepted by topic author marieanissa

 

Hello,

You have to put the constant end of line( in Programation>>String) between the différents values.

SMIRES,

Message 3 of 8
(3,536 Views)

Great it finally works !!

thank you everyone 🙂

0 Kudos
Message 4 of 8
(3,526 Views)

Now i have an other problem.

I want my computer reads the different lines and interprets it as each line is a value for a position of the platform how can i do this ?

thank you

0 Kudos
Message 5 of 8
(3,505 Views)

Hi Marie,

 

I want my computer reads the different lines and interprets it as each line is a value for a position of the platform how can i do this ?

Then you should read the text file line by line and interpret each line/value!

There is a function able to read textfiles line by line. And there are functions to convert tet to numbers. Well, there even is a function that reads a whole spreadsheet file (aka delimited text file) and converts it to numbers in one step!

 

What have you tried so far? Where are you stuck?

Where is your VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(3,500 Views)

You could use the Read From Delimited File to get the array of values.

 

Or you can use Read From Text File, right-click on it and choose Read Lines, set the number of lines to read to -1 (read all) and now it will output an array of strings (each element is a line from the file).


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 7 of 8
(3,493 Views)

Please marieanissa do not ask the same question at different places.

Lire-un-fichier-texte

0 Kudos
Message 8 of 8
(3,479 Views)