in reply to mysqldump files
sigh, i misunderstood how mysql was escaping newline and tab. the following code properly reads the file output by mysqldump (although it may not be the most efficient):
my $line = ''; while (<$in>) { $line .= $_; next if m/\\$/; chomp $line; my @cols = (''); my @tabs = split /\t/, $line; foreach (@tabs) { $cols[$#cols] =~ m/\\$/ and do { $cols[$#cols] .= "\t$_"; next; }; push @cols, $_; } shift @cols; <processing done here> $line = ''; }
|
|---|