Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to read the file directory into a cursor.

Status
Not open for further replies.

ctbaker

Programmer
May 8, 2003
26
US
I am trying to read in the filenames of all the excel files in a particular directory and then place those names into a temporary cursor called cPreImport. The problem is that FoxPro puts the filenames from the DIR command into two columns and I can't get FoxPro to read the second column of file names in the text file it created in the DIR command.

Any ideas how to make this work?
Thanks

Code:
SET SAFETY OFF
DIR LIKE d:\temp\fnfbatch\*.XLS TO FILE &lc_importfile_savename
SET SAFETY ON

*****************************************************
*	Create temporary cursor to hold file names
*****************************************************
CREATE CURSOR cPreImport (Name c(13))

SELECT cPreImport
APPEND FROM &lc_importfile_savename DELIMITED WITH BLANK
 
Hi ctBaker,


=ADIR(aFiles,"*.XL?)

See the FAQ how you can build a cursor for files..

A cursor to collect all files in a specific directory
faq184-3102




ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top