afasch01 has asked for the wisdom of the Perl Monks concerning the following question:
and two...I can get the file renamed but I cannot get only the unique data into the file, all the data is moved into the file, I only need the selected data.
Here is the script, (be kind I am just learning perl)
$file = "project.txt"; open(FILE,"$file"); open(OUTPUT,">> project.out"); while(my $a=<FILE>) { if($a=~/\tCM+(\d*)/io) { print "$1\n"; print OUTPUT $a; } } close FILE; close OUTPUT;
update (broquaint): added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: creating a new file with unique values
by Gilimanjaro (Hermit) on Jan 20, 2003 at 17:42 UTC | |
|
Re: creating a new file with unique values
by BrowserUk (Patriarch) on Jan 20, 2003 at 17:55 UTC | |
|
Re: creating a new file with unique values
by hardburn (Abbot) on Jan 20, 2003 at 17:35 UTC | |
by poj (Abbot) on Jan 20, 2003 at 17:52 UTC | |
by Gilimanjaro (Hermit) on Jan 20, 2003 at 17:51 UTC | |
|
Re: creating a new file with unique values
by jmcnamara (Monsignor) on Jan 20, 2003 at 18:08 UTC | |
|
Re: creating a new file with unique values
by afasch01 (Initiate) on Jan 23, 2003 at 22:30 UTC |