Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ANSI X12 837 Conversion
Message
De
12/08/2001 13:26:00
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
11/08/2001 23:06:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00542599
Message ID:
00542775
Vues:
13
>Thanks Hilmar,
>I am familiar with basic delimited text imports but this file format
>is kind of tricky. It is '~','*', and '<' delimited and does
>all sorts of multiple loops throughout. Each record has a unique identifier
>which is a 2 or 3 letter code so I was planning on using
>those codes to perform all the functions. not sure if I am going to do
>all the coversion from the file itself or import to cursor and perform
>functions from their..we'll see.
>
>thanks again...
>Ronnie

Let's say each record is on a separate line, in a text file.

Read each line.

Use at() to search for a specific delimiter. Save the position to a variable.

Read all characters up to the delimiter. Copy remaining line back to current line.

Example:
lnPosition = at("~", lcCurrentLine)
replace Field1 with left(lcCurrentLine,lnPosition - 1)
lcCurrentLine = substr(lcCurrentLine, lnPosition + 1)
To actually get the file into memory, use FileToStr(). To separate into lines, use alines().

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform