in reply to Re^2: issue with LF & CRLF
in thread issue with LF & CRLF
Okay, the data looks just as you described it. I placed it into a file named "failing.csv" and ran:
Which produced...use Parse::CSV; use Data::Dump 'pp'; my $fh = new IO::File('failing.csv', 'r'); my $fail = do { local $/; <$fh> }; pp $fail; # Print input $fh->seek(0,0); $/ = "\r\n"; my $parser = Parse::CSV->new( handle => $fh, csv_attr => { binary => 1 }, ); pp $_ while $_ = $parser->fetch; # Print output
"\"Networking Hardware \",\"MDUSR226 \",\"10 Gigabit LR Networking +TAP \",\"USR4516 \",\"USRobotics + \",363.33,454.17,0\r\n\"Networking Hardware \",\"MDUSR227 \" +,\"Tap Rackmount for 3 units\n \",\"USR4500-RMK +\",\"USRobotics \",43.33,54.17,0\r\n" [ "Networking Hardware ", "MDUSR226 ", "10 Gigabit LR Networking TAP ", "USR4516 ", "USRobotics ", 363.33, 454.17, 0, ] [ "Networking Hardware ", "MDUSR227 ", "Tap Rackmount for 3 units\n ", "USR4500-RMK ", "USRobotics ", 43.33, 54.17, 0, ]
If this doesn't work for you there is some local configuration issue. Odd.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: issue with LF & CRLF
by nafri (Initiate) on Aug 07, 2013 at 23:40 UTC |