Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions Subject: Re: Stupid awk question Message-ID: <15023@bloom-beacon.MIT.EDU> Date: 11 Oct 89 06:48:16 GMT References: Sender: news@bloom-beacon.MIT.EDU Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Distribution: comp Organization: Massachusetts Institute of Technology Lines: 36 In article dmaustin@vivid.sun.com (Darren Austin) writes: >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 Allow me to quote from "Awk -- A Pattern Scanning and Processing Language (Second Edition)", by Alfred V. Aho, Brian W. Kernighan, and Peter J. Weinberger. I got my copy out of /usr/doc on my system. Page 2, on section 1.4 about printing, says, "Naturally there is a limit on the number of output files; currently it is 10." A lot of implementations have overcome this limitation. Apparently, the version of awk you are using has not. May I suggest either nawk (I don't know where/under what conditions that's available), or gawk (available for nothing whereever fine GNU products are distributed)? Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-4261 Home: 617-782-0710 P.S. Despite the title you gave it, it's not really a "stupid" awk question, especially since the man page doesn't even appear to mention this limitation, or at least not that I could find.