Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with reading from multiple text files
Message
De
01/03/2005 22:32:35
 
 
À
01/03/2005 22:11:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Database:
Visual FoxPro
Divers
Thread ID:
00991855
Message ID:
00991856
Vues:
21
Look into the ADIR() function. It will load the files into an array for you. You can pass it a skeleton too (i.e. ADIR(laFiles,"*.dat")). It also accepts a parameter that will help you to go through the subdirectories as well.

Code will be something to the effect of:
lnFileCount=ADIR(laFiles,'*.dat')
For lnFile = 1 to lnFileCount
  lcFileName=laFiles[lnFile,1]
  Append From &lcFileName SDF
EndFor
Of course you'll have to add in code to have it scan through the subfolders as well.

Aloha,

James

>how do i get a list of all filenames with a .dat extension stored in a folder? also, i want to read data from these files and append it to a table.
>
>do i save first all files with .dat in an array, then read and append them one by one in a table?
>
>there are multiple folders too, with folder names such as reg01 to reg14.. i want to be able to read in each folder all files with .dat extensions.
>
>how do i do that?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform