in reply to Re (tilly) 2: Regexp nightmare
in thread Regexp nightmare with CSV
# Code that writes CSV out. $csvstring=~s/\cM\cJ/\cM/g; print SH $string."\cM\cJ"; # Code that reads Parses CSV { local $/ = "\cM\cJ"; # end of line is now \cM\cJ while (<INFILE>){ if ($csv->parse($line) ){ my @columns=$csv->fields; # Process data here }else{ die "Error Parsing: $csv->error_input\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 4: Regexp nightmare
by tilly (Archbishop) on May 29, 2001 at 06:31 UTC | |
by shotgunefx (Parson) on May 29, 2001 at 11:47 UTC |