Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing break lines from a .txt file
Message
From
21/02/2007 16:51:15
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01197525
Message ID:
01197788
Views:
16
>>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 ""
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform