Path: utzoo!dciem!nrcaer!scs!spl1!laidbak!att!cbnews!ask
From: ask@cbnews.ATT.COM (Arthur S. Kamlet)
Newsgroups: comp.unix.questions
Subject: Re: tabs converted to spaces?
Message-ID: <774@cbnews.ATT.COM>
Date: 3 Aug 88 05:50:23 GMT
Article-I.D.: cbnews.774
References: <3940001@hpgrla.HP.COM> <187@alobar.ATT.COM> <4425@ptsfa.PacBell.COM> <288@dawson.fpssun.fps.com>
Reply-To: ask@cbnews.ATT.COM (Arthur S. Kamlet)
Organization: AT&T Bell Laboratories, Columbus
Lines: 21

>> >Is there a filter which converts tabs to n-spaces throughout
>> >a file?

>> You might try newform and/or sed.

>Several replies have mentioned tr or sed. I assume that the desired
>result is to convert tabs to spaces *in a fomat preserving manner*.
>The correct standard tool to do this in UNIX is expand. Expand is
>designed to perform exactly this function (and its inverse 'unexpand')
>and does so very well.

On our UNIX V system, col -x works pretty  well.

	col -x < oldfile   > newfile

	or: cat oldfile | col -x  > newfile

seems to work rather quickly and simply.

-- 
Art Kamlet  ask@cbrmb.att.com  AT&T Bell Laboratories, Columbus