Hi, I have been asked to write a perl script, to Delete 1 field in a
input file and then print to a output file!
What I need to delete from the file is: Field [3]
Can any body please suggest what else needs to be added to the
script that I wrote below to do this task please.
The big problem being that the data in the File is not sorted in any
form,
e.g. no Headings etc. The only thing separating the fields is a
comment= ,
Here is two data items examples from the input file (each data is streachted
along ONE LINE) :
(The field [3] that I need to get rid of is "006" and the number is not
always the same)
"Value Telecom",98599.00,"006","Welcome to Value Telecom. If you have any
queries please contact Customer Services on 0845 6555000
or visit any Carphone Warehouse
store.","447768111111","SS",,"2001-07-04-08.03.32.221465"
"Value Telecom",98599.00,"006","Welcome to Value Telecom. If you have any
queries please contact Customer Services on 0845 6555000
or visit any Carphone Warehouse
store.","447947022824","SS",,"2001-07-04-08.03.32.221465"
THE PROGRAM so far:
open csv,"<vt04-07-01.csv" or die "Cannot open $ARGV[0]",$!;
open new,">vt04-07-01.csv-changed";
while($line=<csv>){
chomp $line;
$fields[3] =~
}
close csv;
close new;
exit;
[End of file]
Any help would be much appreciated as I only have two days to this
in!!!
Thanks,
GD