Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!rex!ginosko!uunet!hrtix!davr From: davr@hrtix.UUCP (David C. Raines) Newsgroups: comp.unix.questions Subject: Re: extracting "rest of line" in AWK Summary: Printing end of line in AWK Message-ID: <173@hrtix.UUCP> Date: 28 Aug 89 15:13:56 GMT References: <3368@blake.acs.washington.edu> <9363@chinet.chi.il.us> Distribution: na Organization: Treasure Chest Adv Co, NGO, Windsor Locks, CT Lines: 22 In article <9363@chinet.chi.il.us>, john@chinet.chi.il.us (John Mundt) writes: > In article <3368@blake.acs.washington.edu> mbader@cac.washington.edu (Mark Bader) writes: > >Does anyone know of a way to extract the "rest of the line" in awk.. > >e.g. I have a line that looks like > > > >%% Heading "This is a Graph Heading" > > > >and I want to do a {print $3} to get the "This is a Graph Heading" part, > >but this obviously dosen't work. Is there a way to do this? How about: for (v = 3; v <= NF; v++) printf ("%s ", $v) printf "\n" or alternatively (if the quotes are always present), set FS='"' and print $2. -- -- TCA David Raines 5 National Dr. UUCP: ...!uunet!hrtix!davr Windsor Locks, CT 06096