Install CSV_VS module for you through CPAN
$ perl -MCPAN -e shell
read filecsv each column in the line.disassemble "," with ";" inreplace .3rd column "," with " " in 7th column.replace 1,2,3,5,6,7,8 column in the first line.rewrite 1when column includes "#",st file outputsurpress "," at the end of each data.append
# print $fh_out map( { "[$_]\t" } @$columns), "\n";
@$columns[ 3] =~ s/, /; /g; # replace , by ; in column no. 3. this is for the case to include multiple TFS Bug ID in this column.
@$columns[ 7] =~ s/, / /g; #remove comma from the subject.
# replace original header with english version.
@$columns[ 1] = "RM Priority";
@$columns[ 2] = "RM Status";
@$columns[ 3] = "TFS Bug ID";
@$columns[ 5] = "RM Project";
@$columns[ 6] = "RM Filer";
@$columns[ 8] = "RM Component";
@$columns[ 7] = "RM subject";}
# print @$columns[3],"\n";
# print $fh_out map( {"$_,"} @$columns), "\n"; # put , at the end of each column
# if the first column includes pound, this line might be duplicated
}
$line_num++;
}
# print $fh_out map( { "[$_]\t" } @$columns), "\n";
@$columns[ 3] =~ s/, /; /g;
@$columns[ 7] =~ s/, / /g; #remove comma from the subject.
@$columns[ 1] = "RM Priority";
@$columns[ 2] = "RM Status";
@$columns[ 3] = "TFS Bug ID";
@$columns[ 5] = "RM Project";
@$columns[ 6] = "RM Filer";
@$columns[ 8] = "RM Component";
@$columns[ 7] = "RM subject";
}
# print "mark found\n"
}
# print $columns;
$line_num++;
}
$csv->eof ;
0 件のコメント:
コメントを投稿