Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with APPEND FROM
Message
 
À
27/06/2002 10:19:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00672611
Message ID:
00672881
Vues:
7
Thanks, Tamar. I appreciate the clarification.

When I tried the APPEND FROM ... WITH CHARACTER | in VFP6, it parsed out the fields just fine. In VFP3, it doesn't like CHARACTER -- and when it's changed to DELIMITED WITH |, as you would expect, it tries to put the entire line into the first field. Groan...

Yup, I'll be diving into the FOPEN(), FGETS(), etc, realm right now. Now I'll just have to find a good sample program to use so I don't have to reinvent the wheel.

Take care.
- Gerry

>>HDEM|Household demographics|HDEMHHSIZE|Household size|S|HDEMHHSIZE1|One|2|10|1|90|1|1| |
>>HDEM|Household demographics|HDEMHHSIZE|Household size|S|HDEMHHSIZE2|Two|2|10|2|90|2|1| |
>>
>>It's an SDF file that uses '|' as its delimiters. I've copied two lines of it above. -- gww
>>
>
>First, DELIMITED WITH is supported in VFP 3; it's DELIMITED WITH CHARACTER that was added in 5.
>
>Second, your file doesn't use "|" as the delimiter; it uses it as the separator. Here's what we said about this in HackFox (so I don't have to rewrite it <g>):
>
>DELIMITED is for files that contain data with delimiters and separators. There's a lot of confusion about those two, particularly since the command itself mixes them up. Delimiters are characters that surround the data in a field. For example, the word "snazzlefritz" is delimited by quote marks in this sentence. Separators come between two data items. For example, the following list of colors uses commas as separators: "chartreuse, lavender, fuchsia, taupe, teal." A delimited file normally contains both delimiters and separators.
>
>Having said all that, I don't believe APPEND FROM in VFP 3 can parse your file with no delimiters and "|" as the separator. (In fact, without some testing, I'm not sure you can even do it with APPEND FROM in later versions.)
>
>You'll need to either pre-process the file or read it a line at a time with the low-level file functions or by throwing it into a memo field.
>
>Tamar
** Gerry White / Hagerstown, MD, USA --
** Developing since 1986 in Foxpro, VFP, Oracle, and Java.
** http://GerrysPlace.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform