Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comma Delimited File.
Message
De
16/05/2003 16:55:16
 
 
À
16/05/2003 16:24:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00789480
Message ID:
00789503
Vues:
29
>I have a comma delimited file that is populated with characters, dates and numbers.
>
>Is there a VFP6 command that will create a DBF table with the appropriate file structure and append the information from the comma delimited file?

In general, you'll need to create a new, empty table with the correct structure, in advance. There is no magic "parse my text file and create the table for me" command. Make sure each table field is wide enough to handle the largest value for that field in the text file.

If the order and types of the fields is the same as each line in the text file, then you can use APPEND FROM to load the data. Check the help for syntax; more than likely you'll use one of the following depending on exactly how your text file is laid out:
* Sample table creation command:
CREATE TABLE MyTable FREE ;
    (Field1 C(20), ;
    Field2 D, ;
    Field3 I, ;
    Field4 N(7, 2))

SELECT MyTable

* Use one of the following to load the data:
APPEND FROM MyTextFile DELIMITED
APPEND FROM MyTextFile DELIMITED WITH ,
APPEND FROM MyTextFile TYPE CSV
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform