in reply to Re^2: Efficiency issue when reading large CSV files
in thread Efficiency issue when reading large CSV files
or$_ =~ s/some expression meaning a quoted comma/some placeholder/g; @line = split(/\,/, $_); #if the commas are needed foreach my $line (@line){ $line =~ s/some placeholder/,/g; }
You're going to pay a bit of a performance penalty on the 2nd substitution or the more complex matching statement, but it's linear not exponential, so not too bad. Given what you've seen with Text::CSV, I'd wager it'll still be an improvement.@line = split(/some expression that only matches commas not within quo +tes/, $_);
|
|---|