Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site cpsc53.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!akguc!cpsc53!rt From: rt@cpsc53.UUCP (Ron Thompson) Newsgroups: net.unix Subject: Re: Putting in newlines using sed Message-ID: <100111@cpsc53.UUCP> Date: Sun, 17-Nov-85 21:33:26 EST Article-I.D.: cpsc53.100111 Posted: Sun Nov 17 21:33:26 1985 Date-Received: Tue, 19-Nov-85 04:04:26 EST References: <376@bcsaic.UUCP> Organization: ATT-IS CPSC, Atlanta, GA Lines: 25 > I have a process putting out lines that look something like this: > fjlkjf foo (a b c) jflkjf (jfkj) foo (x y a) fjjfj > I want to break up the line so that each "foo" followed by its > parenthesized list of arguments appears on a separate line. I don't > care what happens to the other "words;" they are eliminated in > later processing. > > As far as I can tell, there's no > way of writing the s/... line above with a *real* linefeed in place of the ^ > and J. > With Sys V just type the following from the shell: sed 's/foo/\ > foo/g' filename The backslash escapes your newline producing a series of lines all that begin with foo. -- Ron Thompson AT&T Information Systems Customer Programming ..akgua!cpsc53!rt Atlanta, Georgia Services Center (404) 982-4524 (Opinions expressed are mine alone.)