At 14:13 05.07.2001 +0100, Govinderjit Dhinsa wrote:
> What is the code please to get, after field 6;
> \r (carriage return)
>
> I tried this, but no luck;
> $fields[6] =~ s\r//;
try $fields[6] =~ s/\r//;
^
|
|
note added front slash
>Any help would be much appreciated!!!
>Thanks,
>GD
>
> #####################################################
> PROGRAM:
>
> #!/path/to/perl -w
> use strict;
>
> open CSV,"<vt04-07-01.csv" or die "Cannot open vt04-07-01.csv",$!;
> open NEW,">vt04-07-01.csv-changed";
> while (<CSV>){
> chomp;
>
> my @fields = split ',';
>
> splice @fields, 2, 1;
>
> splice @fields, 5, 1;
>
> $fields[6] =~ s\r//;
>
> for (@fields) { print NEW "$_" }
> }
> close CSV;
> close NEW;
> exit;
>
> [End of file]
> ########################################################
Aaron Craig
Programming
iSoftitler.com