LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert txt file to graph using labview 2011

Solved!
Go to solution

hi all,

 

please help me on how to convert .txt file to graph in labview. the txt file need to be the input file. i attached the txt file. iIt consist of 7 datas according to the date and time. thanks.

0 Kudos
Message 1 of 17
(5,180 Views)

-For some help someone already tried similar check this
https://forums.ni.com/t5/LabVIEW/Plotting-data-from-a-text-file-in-LabView-7-1/td-p/778664
-Use Read from spreadsheet file and give your txt file as input.
-Get the output(2d array) and pass it to proper graph.
-For graphs, please check this
https://www.ni.com/docs/en-US/bundle/labview/page/types-of-graphs-and-charts.html
-Please post then if you are stuck.

Thanks
uday
0 Kudos
Message 2 of 17
(5,176 Views)

Hi varsha,

 

whoever created that text file: (s)he did an horrible job!

- The formatting of the text is completely messed up: it mixes TABs and SPACEs as delimiter.

- There is no LF/CR in it to determine your "7 datas".

- There seems to be no timestamp column in the file: I only noticed just one timestamp in the header ("6/8/2009 5:18 PM"). How should that be applied to the data?

 

So your task is to provide:

- a better formatted text file (where are the "7 datas" in a file of nearly 100kB size?)

- a description of the file content (regarding timestamp information)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 17
(5,168 Views)

hi Gerd,

 

attached is the file which i already sort accordingly. Can u help me to check whether this can be convert to graph or not. thanks 

0 Kudos
Message 4 of 17
(5,096 Views)

Check the image if that's what you need. Sorry i didn't understand the problem clearly. I just opened the txt file and gave the output to waveform graph as i said earlier, this is what i got. Let us know if it is not what you expected. You need to tell us what is your x-axis and y-axis in the data.

Thanks
uday
0 Kudos
Message 5 of 17
(5,075 Views)

Hi varsha,

 

- your text file still uses a wild mix of TABs and SPACEs as delimiter...

- your text file still doesn't show "7 datas", atleast not by column

- your text file still doesn't use any LF/CR to delimite lines

 

Please give a full description of the file/data format...

Best regards,
GerdW


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

Hi,

 

Attached is the image that im looking as output from the .txt file.

 

Thanks!

0 Kudos
Message 7 of 17
(5,014 Views)

Hi varsha,

 

then your problem is solved as you already got that graph?

 

There exists programs to crop your huge attached image to the most interesting part...

Best regards,
GerdW


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

The data file that you attached does not match at all with that image. You can verify that yourself by viewing the file in Excel or a simple text editor. There are columns with values ~50 so importing a specific row does not work. Importing a specific column would not work because there are not enough values. If the image is from an acquisition, it would seem that the export to file was done improperly.

0 Kudos
Message 9 of 17
(4,986 Views)

Sorry for the late reply.

 Attached is the .vi file which converts the .txt file to the output img i attached earlier. I have also attached the flow on how to obtain the desired output as mentioned. The issue is I'm not able to find which block in the .vi file that is performing the transformation of the .txt file (the input).

 

Could anyone help advise? 

 

Thanks and Merry Christmas!

0 Kudos
Message 10 of 17
(4,920 Views)