Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!mcsun!unido!tub!astbe!ber From: ber@astbe.UUCP (H.Bernau) Newsgroups: comp.unix.questions Subject: Re: Stupid awk question Message-ID: <828@astbe.UUCP> Date: 12 Oct 89 06:52:44 GMT References: Reply-To: ber@astbe.UUCP (H.Bernau) Distribution: comp Organization: GEI Software Technik Berlin, Germany Lines: 30 In article dmaustin@vivid.sun.com (Darren Austin) writes: > 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, >[...deleted...] >but it fails with >awk: too many output files 10 >Any help would be appreciated, >--Darren Hi. I've had the same problem some days ago :-( My solution was to make the awk script produce /bin/sh commands: BEGIN { first = 1 } (current == $2) { print } (current != $2) { if( !first) { print "_THIS_IS_EOF_"; first = 0 } current = $2; printf "cat << _THIS_IS_EOF_ > %s.summary\n", $2 } END { print "_THIS_IS_EOF_" } Hope that'll help. ------------------------------------------------------------------------------- | Rolf Bernau | | GEI Software Technik mbH | Berlin: astbe!ber | Hohenzollerndamm 150 | USA: ...!pyramid!tub!astbe!ber | 1000 Berlin 33 | | West-Germany | -------------------------------------------------------------------------------