LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read .txt file instead of .bin file

Hello I currently have a LabVIEW code that reads a .txt and a .bin file, the .txt file only contains info for the header the trial date and some other info, I will attach it. The .bin file contains raw data needed to display the frequency content.

 

I know need to be able to read a .txt file that contains the header, trial date and the raw date all together! 

 

My first approach is to have the code read the first lines for header and trial date and then the information from the second column for frequency content.

 

 

I will like your help to see how can I do this, read the .txt file intead of .txt and .bin files

 

 

thanks

 

p.s. the smaller .txt file is the legacy data, the other one is the one I am trying to read

 

LabVIEW Intermediate I level!
0 Kudos
Message 1 of 15
(4,077 Views)
There's a variety of ways to do this. If the number of lines before the start of the data is fixed, then you can simply read the file using Read From Spreadsheet File as a DBL array and then use Array Subset. If it's not fixed, then read the file as a string array and search for the "Time [s]" column:
Message 2 of 15
(4,070 Views)

Hello,

 

Yes actually it is fixed. All of the time, it will be displayed as the "sample.txt" file, the same location and lines 

LabVIEW Intermediate I level!
0 Kudos
Message 3 of 15
(4,066 Views)
Still I will like to have an example of the type of modification I need to do, please.
LabVIEW Intermediate I level!
0 Kudos
Message 4 of 15
(4,041 Views)
I just showed you what you need to do. Did you see the block diagram I had posted? Both variants are in that figure.
0 Kudos
Message 5 of 15
(4,035 Views)

Let me see if I got it correct, I will be replacing the Read from Binary file with the Read From Spreadsheet File.

 

I am looking in the 1.- PROCESS STATE  section, subsection 3.- LOAD BINARY DATA (1 SECOND OR LESS)   of the VI I have attached, thanks in advance for your response.

LabVIEW Intermediate I level!
0 Kudos
Message 6 of 15
(4,008 Views)
To be honest I did not look at your VI all that much. I stopped after about 30 seconds because my eyes hurt too much. But, basically, it appears that, yes, that's where you'd make the change. I don't know what those two integers that you are calculating are for, though I suspect they're irrelevant if you're reading the text file.
0 Kudos
Message 7 of 15
(4,004 Views)

Thanks a lot for your help, still I am not clear with your example as it shows some columns for the subarray and number, and I don't want to be able to display those, I mean not in that sense.

 

They should be displayed as a graph a spectrographic display

LabVIEW Intermediate I level!
0 Kudos
Message 8 of 15
(3,992 Views)
I don't quite understand what you mean by "shows some columns for the subarray and number". You said you wanted to read the text file and get to the numbers that were in columns. That code does that. If you need just one column then use Index Array to peel off the column you want from the 2D array. If you wrote the code you uploaded then you should know how to do that, since that's fairly basic LabVIEW knowledge. 
0 Kudos
Message 9 of 15
(3,987 Views)
ok, no reason to get excited, thanks anyway
LabVIEW Intermediate I level!
0 Kudos
Message 10 of 15
(3,980 Views)