01-20-2011 03:35 PM
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
01-20-2011 04:18 PM
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.