Re: Print to new file for each results
- From: foskey@xxxxxxxxxxxxxxxx (Ken Foskey)
- Date: Wed, 30 Aug 2006 20:33:37 +1000
On Wed, 2006-08-30 at 00:16 -0400, Ron McKeever wrote:
I am tring to use part of someones elses code that creates a data file which prints
out like this:
ip|result|deptA|data
ip|result|deptB|data
ip|result|deptC|data
If you can ignore efficiency (not run very often...) then you can simply
reopen the file for each record.
while( <> ) {
my @lines = split(/[|]/);
my $file;
open( $file, '>>', "$lines[1].out" ) or die...
print $file $_;
close( $file ) or die...;
}
--
Ken Foskey
FOSS developer
.
- References:
- Print to new file for each results
- From: Ron McKeever
- Print to new file for each results
- Prev by Date: Re: accessing other array indexes other than the current of a foreach
- Next by Date: Re: Totally lost - need a starting point
- Previous by thread: Re: Print to new file for each results
- Index(es):