quick question I have a script that reads in a file and removes a specific line. However what I want it to do is remove all occurances of the specific line except for the first one
Any ideas on how I could do this. I know this is a RDFM question but I am going on vacation today and I need to get it done quick
open FILE, "<" . $filename or die "Couldn't open file " . $fil +ename . " for reading"; while (<FILE>){ $temp .= $_ unless /$heading_to_print/; } close FILE; open FILE, ">" . $filename or die "Couldn't open file " . $fil +ename . " for writing"; print FILE $temp;
Thanks in advance quys
JohnIrl
Sum day soon I'Il lern how 2 spelI (r tYpe)
In reply to Replacing all but one duplicate lines by johnirl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |