#!/usr/bin/perl -w $from_file = $ARGV[0]; $to_file = $ARGV[1]; die("usage: fix_extended_insert \n") if not $from_file; die("usage: fix_extended_insert \n") if not $to_file; # open the from file open(FROM, $from_file); open(TO, ">".$to_file); while () { $_ =~ /INSERT INTO (\S+)/; $table = $1; $_ =~ s|\),\(|\);\nINSERT INTO $table VALUES \(|ig; print TO; } close(FROM); close(TO);