On Mon, Apr 17, 2023 at 12:04 PM Joe Yoder <j...@wheypower.com> wrote:

> I thought I could simply preprocess the file and change each occurrence of
> a single line feed with a comma but when I look at functions available I
> suspect it will be painfully slow.
>
> Any ideas appreciated,
>

You ought to try it before rejecting it. VFP may surprise you. Nothing
runs like the fox.

If I was trying to replace orphan single linefeeds with commas, I'd do
something like this:

#DEFINE CRLF CHR(13)+CHR(10)
#DEFINE LF CHR(10)
badstr = FileToStr("mybadfile.csv")
goodstr = STRTRAN(badstr, CRLF, "~~")
goodstr = STRTRAN(goodstr, LF, ',')
goodstr = STRTRAN(goodstr, "~~", CRLF)
StrToFile(goodstr, "mygoodfile.csv")

Check to ensure ~~ don't exist in the original file, or substitute
your own placeholders.

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/CACW6n4v7JFA+bXJ9gf1Hduxn4WRs=v0dxochk7k_2wkuid6...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to