in reply to Appending data to large files
I'd use Text::CSV_XS to read the CSV file. I'd read the file you're trying to change a little at a time, looking for the delimiter, and insert the CSV records when I find it.
my $record_end = qq{\$\$\$\$\n}; while (<DATAFILE>) { next if ( $_ ne $record_end ); # insert stuff from CSV here } continue { print OUT; }
You don't have to read all of any file at once or even mess around with regular expressions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Appending data to large files
by joec_ (Scribe) on Jan 13, 2009 at 17:24 UTC | |
by kyle (Abbot) on Jan 13, 2009 at 17:45 UTC | |
by joec_ (Scribe) on Jan 14, 2009 at 09:37 UTC | |
by kyle (Abbot) on Jan 14, 2009 at 13:33 UTC |