Path: utzoo!attcan!uunet!munnari!uqcspe!bunyip!uqvax!csvax!cszohagan From: cszohagan@qit.edu.au Newsgroups: comp.unix.wizards Subject: Re: Redirecting output in AWKREAD/NEW/FOLLOWUP Message-ID: <1169@qit.edu.au> Date: 4 Nov 88 19:50:43 GMT References: <816@mergvax> <1988Oct5.233609.15321@utzoo.uucp> Organization: Queensland Institute of Technology Lines: 26 In article <1988Oct5.233609.15321@utzoo.uucp>, henry@utzoo.uucp (Henry Spencer) writes: > In article <816@mergvax> rkxyv@mergvax (Rob Kedoin) writes: >>I am trying to use AWK to split one file into many formatted, smaller files. >>The problem I am having is that I cannot output to more than 10 files... > > Well, it won't help you right now, but the long-term fix is to complain > to your software supplier and ask them to get rid of the silly limit. > It's not that hard. The limits are based on the number of file descriptors that can be open at one time (usually small). One way that I often get around this is by writting something like this which splits up the input on the field $1 . sort +0 | awk ' { if (last != $1) { if (NR > 0) print "!XYZZY"; print "cat > " $1 "< 0) print "!XYZZY"; }' | /bin/sh Tony O'Hagan tonyo@qitfit.qitcs.oz