in reply to Re^4: foreach type of deal?
in thread foreach type of deal?
now what can I use to replace the printf, to use to delete?
You have now entered a situation i dont like. You seem to want to want to replace the original file. for the most part i dont like to do that (at first). I dont like to modify my only copy of the original data. What i do instead is write a new file, then use the new file in later processing.
Note also the change from printf to print. You should read about what printf does in regards to the first argument being a format. What you wanted instead was print.use strict; use warnings; main(@ARGV); sub main { open(my $in ,'<', "gtype.txt"); open(my $out ,'>', "fixed-gtype.txt"); while( my $line = <$in> ) { my $line = substr($line,1); print $out $line; } } close $in; close $out;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: foreach type of deal?
by hoagies (Initiate) on Mar 15, 2017 at 21:47 UTC | |
by huck (Prior) on Mar 15, 2017 at 21:50 UTC | |
by hoagies (Initiate) on Mar 15, 2017 at 22:26 UTC |