wickedxter has asked for the wisdom of the Perl Monks concerning the following question:
open(FILE,"$location/$file"); flock(FILE,2); @data = <FILE>; close(FILE); open(FILE,"$location/$file"); while (<FILE>){ ($name,$dir,$des,$dl,$style) = split(/\|/); if($name eq "$cat_name_del"){ print FILE "\n"; } else { print FILE "$name|$dir|$dl|$style|\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: remove new lines in flat files
by jlongino (Parson) on Sep 03, 2001 at 22:15 UTC | |
|
Re: remove new lines in flat files
by tachyon (Chancellor) on Sep 03, 2001 at 22:55 UTC | |
by Anonymous Monk on Sep 04, 2001 at 04:02 UTC | |
|
Re: remove new lines in flat files
by Hofmator (Curate) on Sep 04, 2001 at 12:36 UTC |