Jump to content
angeloman

problem with FDBatchMove

Recommended Posts

Hi, I use FDBatchMove to import a csv file into an FDMemTable, the file has headers use comma as separator. It contain a column hat is the house number in some cases with extension. Now when it has the extension after the execute it lose it.

Example in input I have 4/A after the execute produce 4/.

 

How can resolve this problem?

 

Thanks so much for the help

Share this post


Link to post
Guest

I do not use FireDAC but it seems it wants to interpret the / or /A as some kind of escape character.

There is an RFC describing CSV, but the format is legacy and tricky and some stuff differ with language/os and such.

If this is a one-time thing, then you could "massage" or rather "amend" the files using VS Code or Excel or some such.

Depending on the code in FireDAC that reads the CSV, perhaps putting the whole field inside " citation marks will help.

If you have the time to file a QC report and wait for it's resolving, do that!

If you have the sources to FireDAC, trace along and see if you can patch it.

Another solution is to write you own CSV to TDataSet loop or hunt for a 3rd party component. If this is code that should work in production, IMHO you must get to the bottom of it or it will surely bite in the future.

Reading here https://datatracker.ietf.org/doc/html/rfc4180#page-2 it seems FireDAC is wrong, but i have not seen the file so cannot know.

 

HTH

Share this post


Link to post

Solved. It wasn't an fdbatchmove parser problem but it it happens because the analyzesamples was setted to 100 and the csv file line was at the near the end. So the target field length was to small to contain the whole field. setting it to 100000 works good

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×