On Mon, Apr 17, 2023 at 12:04 PM Joe Yoder joe@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.