in reply to splitting cvs file without line breaks

rendier,
Why can't you still use one of the CSV modules? My experience with Text::CSV for instance tells me you can read the one long line into an @fields array and then process @fields in groups of N. Of course, you will want to write the file back out correctly so that you only have to go through this exercise once.

Cheers - L~R

  • Comment on Re: splitting cvs file without line breaks

Replies are listed 'Best First'.
Re^2: splitting cvs file without line breaks
by shmem (Chancellor) on May 15, 2007 at 16:35 UTC
    Hmm... based on the sample input
    "Tender Total" 2007-05-14 00:00:00.0

    would make up just one field? And that's where the line break was..

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      shmem,
      You are correct and I was wrong. I had incorrectly assumed that the line endings had been replaced with the CSV delimeter. The process I outlined could still work but it would be more cumbersome (splitting Nth fields).

      Cheers - L~R