Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions Subject: Re: Inserting Blank Line into File (sed/awk/?) Message-ID: <1991Mar15.183105.19269@athena.mit.edu> Date: 15 Mar 91 18:31:05 GMT References: <807@oss670.UUCP> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 13 In article <807@oss670.UUCP>, tkevans@oss670.UUCP (Tim Evans) writes: |> I would like to be able to insert blank lines at regular intervals |> in a structured file. Specifically, I want to place a blank line after |> every third line in my input file. Every third line in the input file |> begins with a specific character string. awk '{print} NR % 3 == 0 {print ""}' -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710