Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append from
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01045038
Message ID:
01058727
Views:
17
Thanks for routine below

But I think there´s something wrong
( I already replaced the colon by comma but not worked)

Lines in my file are delimited as below (good file)

15526,"07/10/2005 20:49:00","JOHN MEDEIROS", 150.00, "OBSERVATION", 350.00
15527,"07/10/2005 20:49:00","PAUL MACCOY", 150.00, "OBSERVATION", 250.00

Sometimes costumer types enter in the observation, and it stays as below:

15526,"07/10/2005 20:49:00","JOHN MEDEIROS", 150.00, "OBSERVATIONxxxxxxxx xxxxxxxxxxxxxxxAAAAAAAAAAAAAAAAAAAAAA", 350.00
15527,"07/10/2005 20:49:00","PAUL MACCOY", 150.00, "OBSERVATION", 250.00

Any help will be welcome

Moises


lcFileName = "myfile.csv"
lcFileNameOut = "myfile2.csv"
* # of colons per line ( # of fields - 1 )
lnColonsPerLine = 3

lhIn = FOPEN(lcFileName)
lhOut = FCREATE(lcFileNameOut)

DO WHILE NOT FEOF(lhIn)
lcStr = FGETS(lhIn, 512)
DO WHILE OCCURS(":", lcStr) < lnColonsPerLine
* Replace ENTER with SPACE
lcStr = lcStr + SPACE(1) + FGETS(lhIn, 512)
ENDDO
IF NOT EMPTY(lcStr)
FPUTS(lhOut, lcStr)
ENDIF
ENDDO

FCLOSE(lhIn)
FCLOSE(lhOut)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform