Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append mult. text files
Message
From
01/07/1997 15:51:11
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00038247
Message ID:
00038301
Views:
43
> >I would like to know is there a way to append multiple text files that had > delimiter by colons?? > >My main problem is that the files name are dynamic (change everytime) > >any idea!! > > You could place any text files in a subdirectory of their own. Then use > ADIR() function to return an array of filenames found in that > subdirectory. > > lnCount = ADIR(laFiles, ".\TextDir\*.txt") > > lnCount will be the number files found > laFiles is the array name > laFiles(1,1) will be the first file name > laFiles(2,1) will be the second file name, etc. > > You could then set up a loop -- > > For i=1 to alen(laFiles,1) > lcTxtFile = laFiles(i,1) > append from (lcTxtFile) delimited with : > EndFor Using SYS(2000) may be more efficient: m.lcFile = sys(2000,"TEXTDIR\*.TXT") do while not empty(m.lcFile) append from (m.lcFile) etc. m.lcFile = sys(2000,"TEXTDIR\*.TXT",1) enddo
Paul Russell
EMail: prussell@fox.nstn.ca
Phone: (902) 499-5043
Previous
Reply
Map
View

Click here to load this message in the networking platform