LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from tab delimitted text file and write to csv

Is there a way to read a tab delimitted text file and then write that same data to a csv?

I need to do this, but I don't know how to pass from one type of format to the other.

Can someone please help me?

Thanks.

0 Kudos
Message 1 of 11
(6,067 Views)

I just found the answer to my question: http://forums.ni.com/t5/LabVIEW/Comma-delimited/m-p/1204971#M517314

I just need to do the opposite. The problem I have now is that I need to write this info into a csv as a string array, and I don't know how.

Can someone please help me?

Thanks.

0 Kudos
Message 2 of 11
(6,064 Views)

The problem I have now is that my app is replacing not only the tab spaces but also the text to ,. How can I fix this?

0 Kudos
Message 3 of 11
(6,049 Views)

Hi Nando,

 

as a CLAD you should know how to write files!

 

It's the same as with your array question: to create files you will find functions in the file palette! WTF, there are even functions to create spreadsheet files (aka csv aka tsv)!

I think Bob's answer was giving you the way to solve such basic questions…

 

Edit after noticing your 3rd post:

The problem I have now is that my app is replacing not only the tab spaces but also the text to ,. How can I fix this?

When you process files as "raw" text you should save them as "raw" text using simple WriteTextFile function.

If you would use ReadSpreadsheetFile to read your tab-separated file you could easily use WriteSpreadsheetFile to save the data as CSV…

But whatever you do: don't mix the options (as long as you don't know what you're doing as it seems right now)!

Best regards,
GerdW


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

I thought I could use the replace array subset, so I can still use the read from spreadsheet vi, but I don't know if that is the right way to go?

0 Kudos
Message 5 of 11
(6,037 Views)

Hi Nando,

 

read the TSV, save as CSV:
check.png

 

Or stay with plain text:

check.png

 

Remark:

You really should NOT edit your questions to something completely different while someone else is answering you!

Best regards,
GerdW


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

what is the vi that goes connected to the read from spreadsheet vi called?

0 Kudos
Message 7 of 11
(6,018 Views)

I just realized its a write to spreadsheet vi.

0 Kudos
Message 8 of 11
(5,986 Views)

I did as you  told me, but the write to spreadsheet writes all the info in just one cell, instead of multiple columns.

could you please help me again?

0 Kudos
Message 9 of 11
(5,879 Views)
Another quick question.
How would I read all the lines in a spreadsheet, except the first one?
0 Kudos
Message 10 of 11
(5,874 Views)