Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing break lines from a .txt file
Message
De
21/02/2007 16:51:15
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01197525
Message ID:
01197788
Vues:
17
>>The approach I will show you makes a noticeable performance difference even on 15Kb file.
>>
>>>Files are not larger than 50kb per time
>>>
>>>Moises
>
>Mike,
>You got me. Now I am very curious. Check Message #1197540. There Moises post a link to the file, but that file contains no header row. But you always could add one :-)

Specifications are really a good thing. A sample of the file and a sample of the result is important. I examined the file with hex editor. Every line is terminated with ",LF". There is one row with an extra LF.

What should happen to the row with the embedded LF?

How is it that code like strtran(lcFileStr,chr(10)+chr(13),"|") is working at all?

Anyways, here's my contribution. This will read in the file, terminating at the LFs and dropping them too. Then it will output the file with chr(10)+chr(13). It's not as fast on such a small sample, but it's really simple.
CREATE CURSOR temp (cline c(100))
APPEND FROM source.txt TYPE SDF
COPY fields cline TO target.txt DELIMITED WITH ""
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform