General information
Category:
Coding, syntax & commands
Environment versions
Network:
Windows 2003 Server
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only