Gary Kline <[email protected]> wrote:

> how to i get, say
> hello, \t how are \t you 
> to translate to
> hello, how are you
> [?]
> in other words, tab -> 1 space rather than the defaul of 4.

You only need something like "expand" or "tab.c" if you want
to convert each tab to a variable number of spaces depending on
column position.  If you just want each tab to become a single
space, which is what I think your "in other words" says:

$ tr '\011' ' ' < input > output

If you want each _sequence of one or more tabs and/or spaces_
to become a single space, which is what the example looks like:

$ sed 's/[ ^I][ ^I]*/ /g' < input > output

(^I represents an actual tab character; in bash I get that by
the two-keystroke sequence CtrlV CtrlI but other shells may vary.
Dunno offhand if sed would understand the \t or \011 notation.)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"

Reply via email to