Quote:
Originally Posted by bergalas
could we add something to this
to replace || With |NULL|? Im not that good with perl
|
I believe this will do the trick:
Code:
while(<STDIN>) {
chomp();
s/'/\\'/g;
s/||/|NULL|/g;
@f=split("(?<!\\\\)\\|", $_);
$insert2=join("','",@f);
$#f--;
grep(s/\\\|/\\\\\|/g,@f);
grep(s/"/\\\\"/g,@f);
$statement=sprintf("%s%s','13THFLOOR',now()",$inse rt,$insert2,join('|',@f));
$dbh->do($statement);
printf("Processing: %d %s \r",$f[4],$f[1]);
++$count;
}