use Modern::Perl; use DBI; my $dbh = DBI->connect( "dbi:CSV:", undef, undef, { f_ext => '.csv', f_dir => 'D:/Perl/scripts', RaiseError => 1, } ) or die "Cannot connect: $DBI::errstr"; $dbh->do(q/UPDATE test SET First = 'CONDENSED' WHERE test.First = 'C'/ +); $dbh->do(q/UPDATE test SET First = 'FINAL' WHERE test.First = 'F'/); $dbh->do(q/UPDATE test SET Fifth = 'Ohio' WHERE test.Fifth = '0H'/); $dbh->do(q/UPDATE test SET Fifth = 'Oregon' WHERE test.Fifth = '0R'/);
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
My blog: Imperial DeltronicsIn reply to Re: Search/Replace within fields of CSV
by CountZero
in thread Search/Replace within fields of CSV
by johnmck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |