LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble in reading csv file

Solved!
Go to solution

Hi friends,

I am having a series of csv files in a folder and i am trying to read it one by one in labview. Each csv file has two column and i want second column data for processing it. The problem i am facing in Labview is it can able to read the second column for the first iteration and for successive iteration the data i got is zero. Labview not able to read 2nd column for successive iterations. 

0 Kudos
Message 1 of 15
(748 Views)
Solution
Accepted by BOND002

The default delimiter on that function is a tab character, and I am guessing you have comma's as delimiters in your file.

 

Rather annoyingly the delimeter terminal is set to optional so doesn't show up straight away on the context help. It is on the bottom edge in the middle. See the attached file.

 

For the future, it is much easier if you post your actual VI rather than a picture.

0 Kudos
Message 2 of 15
(717 Views)

Thank you Niatross

0 Kudos
Message 3 of 15
(698 Views)

Thank you for your help. I have another trouble here while reading series of files in the folder which are named in the form of sequence manner like 1 (1), 1 (2), 1 (3), 1 (4), 1(5),... but Labview reads it as below sequence. 

1(10)

1(100)

1(1000)

1(1001)

1(1002)

Can you figure out how to read it sequentially like 1 (1), 1 (2), 1 (3), 1 (4), 1(5),... 

0 Kudos
Message 4 of 15
(688 Views)

Hi Bond,

 

you need to sort the filenames numerically instead of alphabetically!

 

Use ListFolder to get an array of filenames, then sort it according to your requirements...

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 5 of 15
(677 Views)

Hi Friends,

I am facing issue in labview. My vi read csv file in a folder and plot it in waveform graph. Initially i have twenty csv file in that folder, while runnning my application some more csv files will be added to that folder. The problem is only twenty csv file initially placed got read, later added csv files were no read by labview. 

LV_fm.png

0 Kudos
Message 6 of 15
(596 Views)

Hi Bond,

 

the VI in your snippet uses ListFolder to get the current files from your folder, then the loop processes them: this is simple THINK DATAFLOW!

 


@BOND002 wrote:

The problem is only twenty csv file initially placed got read, later added csv files were no read by labview. 


What happens when you restart your VI? Does it recognize the newly added files?

In case your answer is "Yes!" then you simply need to change your VI so it can recognize the new files also while running…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 7 of 15
(592 Views)

Hi GerdW,

Thank you for your prompt reply.

When i restart the vi newly added files got recognized.

 

My actual issue is that, i am getting those csv files form my experiments. The csv files will be atuomatically stored in the folder. The number of files in that folder will always keeps on incresing as long as my experiments runs. When my experiment starts the csv files will be generated automatically, i want to run the vi at the same time for real time monitoring with little time lag.

0 Kudos
Message 8 of 15
(586 Views)

Hi Bond,

 

as suggested before: THINK DATAFLOW!

(This is the very basic working principle in LabVIEW!)

 

When you want to detect/list files in a loop then you need to list the files in the loop…

 

Suggestion: Hurry up to take as many "self-paced" courses as possible - they are for free until end of May!

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 9 of 15
(582 Views)

Hi GerdW

I have tried with my little knowledge in LabVIEW... Couldn't able to accomplish my work. Thanks for suggesting me about the NI Courses.

0 Kudos
Message 10 of 15
(550 Views)