Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!amdahl!pacbell!ptsfa!dmt From: dmt@ptsfa.PacBell.COM (Dave Turner) Newsgroups: comp.unix.questions Subject: Re: tabs converted to spaces? Keywords: tr Message-ID: <4425@ptsfa.PacBell.COM> Date: 20 Jul 88 17:55:07 GMT References: <3940001@hpgrla.HP.COM> <187@alobar.ATT.COM> Reply-To: dmt@ptsfa.PacBell.COM (Dave Turner) Organization: Pacific * Bell, San Ramon, CA Lines: 20 In article <3940001@hpgrla.HP.COM> douglasg@hpgrla.HP.COM (@Douglas Genetten) writes: >Is there a filter which converts tabs to n-spaces throughout >a file? You might try newform and/or sed. newform will convert tabs into the correct number of spaces so that the output will appear to have been printed on a printer with tab stops. If your input file assumes that tabs are to appear to have been set every eight spaces try: newform -i-8 -o-0 < inputfile If you want each tab to be converted into a fixed number of spaces use sed: sed -n -e "s/ / /p" < inputfile If you want each tab converted into exactly one space tr will also work. -- Dave Turner 415/542-1299 {att,bellcore,sun,ames,pyramid}!pacbell!dmt