LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extract data from summary data file

Greetings all,

 

I truly hope someone can help me because I am very stcuk and under a huge time constraint. A former engineer wrote some Labview code to acquire data for one of our products. Instead of saving each tested product as its' own data file, he instead created summary data files that contain all the products tested on a particular day. After a year or so of this, it was found to be a nightmare in trying to find a specific serial number, so the code was changed so that each tested product had its' own file.

 

Anyway.... I have now been tasked to extract the individual data sets from the summary files. I could do this manually, but there are over 3000 summary data files. I am hoping someone can show me how to use Labview to extract each set of product data from the summary file, and have it saved to its' own file.

 

Key points:

 

Each saved data file is a text type file

Each name of the file is the products' particular serial number

typical serial number is the of the form: 0HPK-0909-09Y-402107-00103

 

I have attached a typical summary data file as an example.

0 Kudos
Message 1 of 4
(2,315 Views)

Several questions:

  • You said the file you posted is a summary file. What's the output? Are you looking to generate one file for each unique serial number?
  • When you finish with one summary file and you go to the next, if that summary file contains a line with a serial number that existed in the previous summary file what are you supposed to do?
  • How big are these summary files? (the size may warrant one type of solution over another)


You could, for example, read in the file using Read From Spreadsheet File since the files are delimeted. Then you could simply auto-index a for-loop and either:

  • collect the lines per serial number and then write them out to file after you've collated them
  • write out to the corresponding file based on the serial number with each line
0 Kudos
Message 2 of 4
(2,303 Views)

Yes, I would need one file generated for each unique serial number.

 

There is also date and time information at the beginning of each line, for each serial number, within the summary file. If that info could be incorporated into the filename after the serial number, then any duplicate serial numbers would not impact the file creation process.

 

The summary files are all fairly small.... no more than 10-12k in size. There are typically anywhere from 2-3 to no more than 35-40 unique serial numbers in each summary.

0 Kudos
Message 3 of 4
(2,296 Views)
There are many ways to do this. As I noted, one way is to read in the file and auto-index a for-loop, writing out to the corresponding file with each iteration. Attached is an example just to get you started.
0 Kudos
Message 4 of 4
(2,285 Views)