Xref: utzoo comp.unix.wizards:11772 comp.unix.questions:9772 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!uwmcsd1!marque!uunet!mcvax!ukc!reading!riddle!domo From: domo@riddle.UUCP (Dominic Dunlop) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: Redirecting output in AWK Summary: No file limit if awk produces series of cats with here documents Message-ID: <928@riddle.UUCP> Date: 13 Oct 88 11:45:46 GMT References: <816@mergvax> Reply-To: domo@riddle.UUCP (Dominic Dunlop) Organization: Sphinx Ltd., Maidenhead, England Lines: 25 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... The way around this problem is to have awk produce output which looks like cat << E_O_F > file1 Data for file1 ... E_O_F cat << E_O_F > file2 Data for file2 E_O_F ... cat << E_O_F > file763 Data for file 763 ... E_O_F and pipe it into the standard input of a shell. You can even have awk do the piping by appending | "sh" to the relevant print and printf lines in the awk script. -- Dominic Dunlop domo@sphinx.co.uk domo@riddle.uucp