Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Open ASCII file & export ASCII file??
Message
De
15/05/2001 14:26:57
 
 
À
15/05/2001 12:56:46
Peter Brama
West Pointe Enterprises
Detroit, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00507392
Message ID:
00507430
Vues:
8
>I am using VFP6.0 and have a customer that needs to have some data re-manipulated and exported out in
>an ASCII, comma delimited format.
>
>The file to import is a "text" print to file of a report from another application. I need to read in the lines,
>remove the headers and captions, break the data locations (position delimited) into seperate data fields,
>compare data to a specific "table" of records to "clean up" telephone #s, then write a ascii delimited, text
>based, 1 record per row, with a few of the fields imported in.
>
>I believe VFP can do all this but am having trouble finding information on how to import the file lines,
>manipulate the lines (remove data, combine lines), and create the exported file.
>
>Suggestions?
>
>Thanks
>
>Peter Brama
>West Pointe Enterprises
Peter,
We do a lot of this type of work. For a general framework, I would:
1. Recreate the input file by removing the headers and captions using either filetostr() and strtofile() methodology or low level file function including
fopen(), fcreate(), fgets() and fputs().
2. Append the modified into a table using APPEND FROM ... SDF
3. Manipulate the data as necessary.
4. Output the required fields using COPY TO ... DELMITED
Good luck. VFP is actually a great tool for this type of project.
-Dore
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform