You can use notepad ++ find and replace to preprocess the file. Rick Q quilh...@gmail.com
On Mon, Apr 17, 2023 at 12:04 PM Joe Yoder <j...@wheypower.com> wrote: > Alan and all, > I have researched the problem records and find that they have line feed > characters without a leading carriage return. This results from the > operator hitting a return in a notes field of the accounting package I am > using. > > Apparently Excel import insists on a combination of carriage return and > line feed while VFP's append from delimited accepts a line feed by itself. > It seems to me I am not the first person to figure this out and that surely > there is a parameter to alter this behavior. > > 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, > > Joe > > On Sun, Apr 16, 2023 at 1:49 PM Alan Bourke <alanpbou...@fastmail.fm> > wrote: > > > 'Append from' has always been bombproof in my experience, as long as what > > you're giving it is correct. Do those problem rows have any weird non > ASCII > > characters ir anything? > > > > -- > > Alan Bourke > > alanpbourke (at) fastmail (dot) fm > > > > On Sun, 16 Apr 2023, at 3:35 AM, Joe Yoder wrote: > > > I have an accounting system data dump that I export each year at tax > > time, > > > I think I have always had a few records that got mangled but this year > I > > > would like to solve the problem. > > > > > > My preferred technique is to create a cursor with the fields I need to > > > import along with any required place holders. I then append from the > > ,CSV > > > file type delimited. This is very fast and seems to be perfect except > > for > > > about 24 records out of 10,000. What happens is that fields that > belong > > in > > > later positions in some records show up in the first field position. > It > > > seems some records are handled as though they have a carriage return > > > linefeed too early and what follows ends up at the beginning of the > > > following record. > > > > > > I have investigated Low level file input using an fgets function to > pull > > > records out one at a time. This is obviously slower and still seems to > > > have the same problem. > > > > > > Another possible approach would be to pull the entire file into memory > > and > > > parse everything out from there. This will take much more time and be > a > > > lot of work to set up but might make sense to try. > > > > > > Finally I have opened the file in Excel with no problem. Some of the > > > fields that want to show up in the left field in VFP stay where they > > belong > > > in Excel. I don't like to add a process in another package but it may > > make > > > sense to do so. > > > > > > Any wisdom will be much appreciated. > > > Thanks in advance, > > > > > > Joe > > > > > > > > > --- StripMime Report -- processed MIME parts --- > > > multipart/alternative > > > text/plain (text body -- kept) > > > text/html > > > --- > > > [excessive quoting removed by server] _______________________________________________ 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/cadazp2mpzaduw+cakqbh_bjyhcolmbror_lvmjvbb-7nleo...@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.