in reply to Re^3: Problem parsing semicolon delimited file with DBD::CSV
in thread Problem parsing semicolon delimited file with DBD::CSV

I tried as you suggested.

If I use DBD::CSV without DBD::AnyData it works great, when I use DBD::AnyData and pass the eol and field separator character through it dies with the messages in the original message.

I am running ActivePerl 5.8 on Windows using Komodo 3.5 to do the development and debugging.

As I run the debugger, I find that as the code moves from DBD::AnyData to DBD::CSV, CSV parses the first record correctly but for some reason as the code jumps back to DBD::AnyData, AnyData does not see the parsed record and dies with the messages in the original message.

Being a novice not sure why or whatelse to look for but it is interesting your code works and mine does not. One other thing I found is my records are terminated with CRLF which I was able to pass to DBD::AnyData and parse the records fine and with DBD::CSV I use just the \n and it parses the records fine while if I pass DBD::AnyData just the \n it does not parse the records at all.

Sorry this is so long wind and may be rambling but I am trying my best to provide reasonably good information to help.

Thanks
Mike

  • Comment on Re^4: Problem parsing semicolon delimited file with DBD::CSV

Replies are listed 'Best First'.
Re^5: Problem parsing semicolon delimited file with DBD::CSV
by ikegami (Patriarch) on Jul 30, 2006 at 16:02 UTC
    Which version of these modules do you have? Can you show us your code?
Re^5: Problem parsing semicolon delimited file with DBD::CSV
by jZed (Prior) on Jul 30, 2006 at 17:16 UTC
    You wrote:
    Being a novice not sure why or whatelse to look for but it is interesting your code works and mine does not. One other thing I found is my records are terminated with CRLF which I was able to pass to DBD::AnyData and parse the records fine and with DBD::CSV I use just the \n and it parses the records fine while if I pass DBD::AnyData just the \n it does not parse the records at all.
    Well, don't look any further, that is the answer. Neither module can parse CSV files without knowing what the record terminator is. In DBD://AnyData, the default is "\n", in other words the line terminator for the OS on which the program is running. In DBD::CSV the default is "\015\012" (CRLF) which will only be the same as the line terminator when the program is running in windows.

    Thanks for following up and letting me know how you resolved the issue.