Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append from
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01045038
Message ID:
01058727
Vues:
18
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform