Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement