extracting "rest of line" in AWK

David C. Raines davr at hrtix.UUCP
Tue Aug 29 01:13:56 AEST 1989


In article <9363 at chinet.chi.il.us>, john at chinet.chi.il.us (John Mundt) writes:
> In article <3368 at blake.acs.washington.edu> mbader at 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



More information about the Comp.unix.questions mailing list