Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with a Foxpro programming question
Message
De
09/09/2000 12:37:04
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
09/09/2000 12:22:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00414601
Message ID:
00414603
Vues:
22
>To anyone willing to help:
>
>This is my first time utilizing the forum. I would like to post this question about a small programming question I have and the best way to write the code. What I am attempting to do is append multiple text files with different names (but all have the exact same structure) to a table. The line of code I am currently using from the command window is APPEND FROM C:\DATA\CHARLOTTEPERSONS.TXT DELIMITED WITH CHARACTER :
>
>My problem is I have hundreds of files to append, and all that changes is the city name in front of persons.txt. It is very tedious to go city by city. Couldn't I automate this using a variable statement somehow ? Any help would be greatly appreciated.
>
>Thank you.
>
>
>Phil Von Haak
>International Internet
>vonhaak@aol.com


Wellcome Phil :)
You could automate it in many ways. I'll provide one assuming all txt files are kept in a separate directory :
lcDir = getdir()
if empty(lcDir)
 messagebox('No dir selected')
 return
endif
lnFiles = adir(aTextFiles,lcDir+'*.txt')
for ix = 1 to lnFiles
  APPEND FROM ;
    (lcDir+aTextFiles[ix,1]) ;
    DELIMITED WITH CHARACTER :
endfor
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform