LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parse Data from Text file

I'm using LV 8 for the first time and attempting to parse a text file that is generated from a bubble counting machine.  The data is written to a text file and currently I have to manually edit the file to obtain the data and then graph it in excel.  After attending LabView Basics class I though I might be able to extract the necessary data and graph it using labview but so far I've been unsuccessful.  I am attaching a sample text file and also a pdf that highlights (yellow) the sections of the text that I would like to extract (rather I'm trying to attach files).  The real data files are much larger however this sample text should be a good representation and includes the difficult sections for this parsing challenge. 
 
The following is information that I think might be helpful:  The instrument works by taking a reading for a chosen time interval (60sec, 120sec, etc.) and at the end of the reading the instruments writes the acquired data to a text file, this repeats and the text file grows with each new reading interval (the size of the file depends on how many samples you observe). Text File: For each interval it places a time and date stamp on line #1, the second line is the "title" of that reading which changes and can include text and numbers, the third line reports the recording # and recording length, the remaining lines in each section (each interval) report the counts (number of bubbles) recorded in each of 15 levels (the levels are bubble size), as you can see from the highlighted pdf I'm only interested in the section that reports counts and the total for the "current interval."  As you can see from the data when the instrument doesn't "see" any bubbles during the interval then it reports "No embolis detected..." and as a result these sections of the text file have fewer lines than the other intervals and no numbers for the "15 levels."  (I had attempted to parse out entire lines but this situation gave me a headache).  I am purposely not posting screen shots of my block diagram attempts because they are pitiful but can do so if that might help.
 
Any help would be greatly appreciated.
Download All
0 Kudos
Message 1 of 3
(5,402 Views)

I think this should do the trick.

I am sure there are some nifty tricks but this just brute forces out the answer.  I made some assumptions so you should test this pretty heavy to make sure that none of the cases fail.  I also noticed that whitespace sneaks in some so that is why I try to remove it all.

Download All
Message 2 of 3
(5,386 Views)
Wow I can't thank you enough for your help!  I am thoroughly impressed!!  Smiley Happy
0 Kudos
Message 3 of 3
(5,374 Views)