LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing and reading multi line tables to and from txt- file

Hello together
 
I'd like to write and read multi line tables to or respectively from text- files. How ist this possible? (I am using LV 8.0)
I am always struggling with the problem, that multi line cells are written to different cols. The same problem occurs if I want to read tables with multiple lines.
I don't even manage to properly read a multi line table saved in excel (as txt, tab stop separated).
I am pretty sure that this is quite easy to do. How?
 
I appreciate any help
 
woodi
0 Kudos
Message 1 of 9
(4,691 Views)

Hi woodi

You can always use the array to spreadsheet function with %s as a parameter ad then write the resulting string to a textfile.

Can you post a non working example, together with the textfile?

 

greetings from the Netherlands
Message 2 of 9
(4,675 Views)

Hello Albert

I have attached a non working example. I guess, it's just a matter of correct syntax elements to bring this to run.

Thank you for your help.

woodi

0 Kudos
Message 3 of 9
(4,670 Views)
I do some changes at the VI, perhaps that is what you want 😉

remeber do not use CARRIAGE RETURN in a cell !

regards
timo
0 Kudos
Message 4 of 9
(4,662 Views)

Hello Timo

I think your changes haven't solved my problem yet. Actually I want to save a table with multiple lines in a certain cell (line change with return or carriage return) to a txt file. Afterwards I'd like to read and put it back to the table. I am not sure whether this is possible or not.

I don't understand how you manage to display, save, open multiline cells in a table with the vi above?

woodi

0 Kudos
Message 5 of 9
(4,657 Views)
hi,
i think you have to change the format:
what about using HTML or Exel (report generation toolkit)

i append a VI which creates a html table (i think i found it in the forum Smiley Wink 😞


Message 6 of 9
(4,647 Views)

Hi Timo

I agree that it is may be better to change to html. But still there's the need to check the table for multiple lines within a cell. I then would have to check the lines for carriage returns and then put some "</br>" into the html code. If there's no better solution,  I have to do it like that.

Thank you for your help.

woodi

0 Kudos
Message 7 of 9
(4,642 Views)
just have a look at the "write table to xl.vi"

regards timo
Message 8 of 9
(4,639 Views)

Timo

I had already a few times a look at this vi. It's very interesting, and might be useful. The thing is, that I would like to save some parameter files before I start data acquisition. So the saving of the table is actually just a background activity, and the user doesn't have to know about this. So the user should not have to bother about opening excel windows and so on. I have studied the "write table to xl.vi", and I think you can't write some Data without opening an excel sheet. Am I wrong?

I agree that my problem is just a matter of elegance. May be I try to work it out with html.

woodi

Message 9 of 9
(4,632 Views)