Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String manipulation in VFP6
Message
 
To
22/06/2001 12:26:34
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00522546
Message ID:
00522894
Views:
9
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform