LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to open files in for loop?

Hi, all

I have .dat files in a folder
e.g.

d:\\0.dat
d:\\1.dat
....
d:\\50.dat

I want to open each file and do some data analysis.
How can I do it in CVI?

Any suggestions will be greatly appreciated!

Stephen
0 Kudos
Message 1 of 2
(2,947 Views)
use a getfirstfile() ... getnextfile loop:
 
if (GetFirstFile ("*.dat", 1, 0, 0, 0, 0, 0, F)==0)
  {
   // process first matched file here
   while ((Ok = GetNextFile (F))==0)
   {
    // do something for the rest
   }
  }
  

note that  this only works on a flat file hierarchy - does not recurse into subdirectories.

Message Edited by josswern on 09-06-2005 08:36 AM

--
Once the game is over, the king and the pawn go back into the same box.
Message 2 of 2
(2,940 Views)