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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append multiple unknown text files into one text file

Status
Not open for further replies.

Lorski

Programmer
Dec 28, 2000
12
US
I am trying to append multiple text files into one text file. The only catch is...we don't know the name of each text file. They are located in tht same folder...just have unique names. Currently we are importing one text file at a time...and would like to append the files to save time. The text file names consist of the order#.txt. I wanted to use "*.txt", but I can't seem to get that to work. I want to read one...process it, move it to another folder... grab the next text file...process it...etc. Thanks in advance.
 
try this . .



dim strFileName as string

strFilename = Dir$({folderpath}/*.txt)

do while len(trim$(strfilename)) > 0

{perform your operation on each file in here}

strFileName = dir$()
loop

- Jeff Marler
(please note, that the page is under construction)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top