From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Open txt file

Hello,

I need to open all txt files in a folder (one by one).

Using this function "OpenFile ("c:\\Users\\file1.txt", VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_ASCII);" i have to give the name of each file but wanna open all the files without giving the name then extract values from each file and put them in an excel file.

How can i make an automatic test without giving the names of all files?

 

Thanks a lot.

0 Kudos
Message 1 of 2
(3,358 Views)

You can build up a loop with GetFirstFile and GetNextFile to extract all the file names, then handle them one-by-one in the loop.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,353 Views)