Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with APPEND FROM
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00672611
Message ID:
00672883
Vues:
7
Before you dive into LLFF stuff...

You say it is type SDF, and your sample looks so to me.
In that case you could use an intermediate file definition that makes a separate FIELD of EACH vertical bar delimiter and giving the relevant data fields the same field names as your destination file. Once data is in the intermediate file, append it to the destination.

good luck


>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform