Stupid awk question

Darren Austin dmaustin at vivid.sun.com
Wed Oct 11 07:59:18 AEST 1989


Hi all,
	I am trying to split up a large output file into several
smaller files.  The smaller files are named after the value in
the second field.  I tried using the following simple awk script,

(current == $2) {print > current".summary"}
(current != $2) {close(current".summary");current=$2;print > current".summary";}

but it fails with 

awk: too many output files 10

so apparently it is running out of file descriptors.  I thought
that would be taken care of by using the "close" function.  Am I
using it incorrectly, or am I doing something else wrong?  Is
there a better way to do this with other tools?

Any help would be appreciated,
--Darren

P.S. This is on a Sun 3/60 SUNOS 4.0.3.
--
--------------------------------------+-------------------------------
Darren Austin                         | Is is a mistake to think you 
Sun Microsystems, Mountain View       | can solve any major problem
dmaustin at sun.com	              | just with potatoes.
--------------------------------------+-------------------------------



More information about the Comp.unix.questions mailing list