LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Processing specified lines of data from a text file

Hi all,

 

I have a VI which calculates an RMS value from a number of samples in a text file. The problem is that when the data files are creating from my DAQ system there are a number of lines at the beginning with information about the configuration of the system etc. Is there any way from modifying the calculation/VI so that it ignores a specified number of lines from the beginning of the file.

 

I hope this is understandable.

 

Many thanks in advance

 

Jack

0 Kudos
Message 1 of 2
(2,249 Views)

Yes. I assume that the header lines and the lines with the data are formatted differently. If so, you can process the file a line at a time and use a regualr expression to match the data lines. If the regular expression matches use that line. If it doesn't match then simply ignore that line of text.

 

You can either read the file a line at a time or read the entire file and process the text a line at a time. If you may be processing large files I recommend reading the file a line at a time. Reading very large files in one read can be very slow. Reading the same file in chunks will be much faster.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 2
(2,242 Views)