Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String manipulation in VFP6
Message
 
À
22/06/2001 12:26:34
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00522546
Message ID:
00522894
Vues:
10
This message has been marked as the solution to the initial question of the thread.
LOCAL lcLine, lnI, lnInput, lnOutput

lnInput = FOPEN(<filename>)
lnOutput = FCREATE(<filename>)
DO WHILE !FEOF(lnInput)
  lcLine = CHRTRAN(FGETS(lnInput),CHR(10) + CHR(13),"")
  FOR lnI = 1 TO LEN(lcLine) STEP 80
    FPUTS(lnOutput,SUBSTR(lcLine,lnI,lnI + 79))
  ENDFOR
ENDDO
FCLOSE(lnInput)
FCLOSE(lnOutput)
This is off the top of my head - I didn't test it, but I hope it helps!

>The in comming file is variable length records. Each record is separated by CRLF. So I have to read each character until I my counter reaches 80 then start over on a new line, or until I reach a CRLF then start a new line.
>
>The output will have a maximum of 80 character per line.
>
>I am looking at the FGETS(). Maybe I can process each line one at time.
>
>Thanks,
>
>Jerryt
Brien R. Givens

Brampwood Systems
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform