Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!rutgers!seismo!brl-adm!brl-smoke!smoke!quilico@CECOM-2.arpa From: quilico@CECOM-2.arpa (Grace Quilico) Newsgroups: net.unix Subject: Help with sed Syntax Message-ID: <4785@brl-smoke.ARPA> Date: Tue, 21-Oct-86 13:26:57 EDT Article-I.D.: brl-smok.4785 Posted: Tue Oct 21 13:26:57 1986 Date-Received: Wed, 22-Oct-86 05:32:02 EDT Sender: news@brl-smoke.ARPA Lines: 31 I'm have been trying (unsuccessfully) to determine what the correct syntax would be for sed to substitute a given expression with multiple newlines. For example, someone from an IBM environment ftp'd a file to me (VAX UNIX System 5.2.2) which is in an IBM printer format. Except for the first line in the file, the beginning of each line in this file (it's over 4 megs) has a leading space, followed by the printer control character (e.g., 1 for top of page, 0 for double-space, - for triple-space, or a blank for space). (The first line has a + in column 1, and a 1 in column 2, followed by the data.) It seems to me that sed would be the utility to use to convert these characters. My problem is with trying to embed newlines in this file. For example, I would like to do something like the following: s/^ 0/\ / where the backslash is to escape a newline character (i.e., substitute a newline for the ' 0', effectively giving me double-spacing), whenever the first two characters on a line are ' 0'. The most I can get it to do is either just remove the ' 0' at the beginning of the line, or I manage to get an embedded newline in *every* line in the file. Can someone with a little more expertise please help me out? Thanks in advance, Grace Quilico Technical Liaison AV 995-2275 Comm: (201) 544-2275