LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading multiple files of different lengths.

Salutations,

I am attempting to read multiple files (number may vary from 1 to 6) of different lengths.  I am looping through the files and reading off so many lines of each one.  Although the files are different lengths, so my read VI will register an "End of File" flag when one of the files ends.  Currently I am just searching an array of these True/False statements to see if any file ended, if it did end, then I am terminating the program.  I would prefer being able to see what exists on the rest of the files, so I'd skip this null file (could be any file) but read all the other files.  I am doing this operation in a for loop, because I am passing an array of files names into the read VI.

Sincerely,
E. Smith
0 Kudos
Message 1 of 3
(2,743 Views)
Hi:

So I guess the files you're reading are text files right? Do you finish the program after you find an EOF of any file? Do you read the files secuentially?  Your problem doesn´t  seem too clear for me. If you want to read all the files whose names are passed through the array, wouldn't it be better to just read all of them secuentially and when you detect the EOF of one file, just start reading the other and so on?


Robst - CLD

Using LabVIEW since version 7.0


0 Kudos
Message 2 of 3
(2,734 Views)
Sorry for the lack of clarification.  I am reading .hty files, using the read from spreadsheet file vi.  I am looping the files because I want to read certain sections of each file together (accelerometer based data).  This way, the time from all the files is coherent, and I'm looking at the same events.  Currently, once I find an EOF the program terminates.  However, maybe a file ended early due to a battery issue, etc....; thus, I want to continue to investigate the other files together, so I can keep monitoring the same event from the accelerometers.

Hopefully this provides some clarification,
E. Smith
0 Kudos
Message 3 of 3
(2,727 Views)