open (OUT, ">Curr_Closed.csv");
open (RAW, "<Prelim_CC.csv") or die "ERROR: Could not open Curr_Cl
+osed.csv";
while (<RAW>){
chomp ($_);
my @columns = split (/,/, $_, 10);
$columns[9] =~ s/,/;/;
print OUT $columns[9]."\n"}
close (RAW);
close (OUT);
What this does is takes only the first comma in 10th column and changes it to semilon. But fields that have more than one comma are still messed up.
Am I using regexp wrong? |