Tabs are EVIL *and* STUPID, end of discussion. (Re: Tabs versus Spaces in Source Code)
Edward Elliott
nobody at 127.0.0.1
Wed May 17 16:46:12 EDT 2006
Dave Hansen wrote:
> On Wed, 17 May 2006 17:28:26 GMT in comp.lang.python, Edward Elliott
>>Just for the sake of completeness:
>>
>>cat file |sed 's/\t/ /g'
>
> That doesn't always work. If you don't see why, you don't understand
> my objection to TAB characters in text files.
>
>>less -x4 file
>
> That will work. As long as the creator of file used four-space TABs,
> anyway...
I fail to see why less 'will work' but cat 'doesn't always work'. The net
effect of both is the same. Unless you're in some weird place that pipes
aren't allowed, these should be equivalent:
cat file |sed 's/\t/ /g' |less
less -x4 file
Now if you're talking about the conversion altering the data's semantics,
that's a separate issue that has nothing to do with unix utilities and
everything to do with the file formatting. In that case, I'll simply refer
you to the rest of this thread for discussion.
--
Edward Elliott
UC Berkeley School of Law (Boalt Hall)
complangpython at eddeye dot net
More information about the Python-list
mailing list