[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
enhancement request: one or more spaces/tabs
From: |
Todd Allen |
Subject: |
enhancement request: one or more spaces/tabs |
Date: |
Tue, 27 Jan 2004 11:20:21 -0700 |
User-agent: |
Mutt/1.4.1i |
coreutils maintainers:
unexpand will expand 2 or more spaces/tabs into an appropriate set of tabs
and spaces. Could it be enhanced with an option to convert 1 space into a
tab also, when appropriate? For example, with this command:
echo "abcdef abcdefg abcdefgh" | unexpand -t 8
The 2-space sequence after abcdef is converted to a tab, but the single space
after abcdefg is not, presumably because there's no space savings in doing
so. But it sure would be convenient if there was an option to convert it to
a tab, too. I've wanted this before when writing shell scripts to read
columnar input. It would be nice to use unexpand like this (in ksh):
unexpand --singletons-too -t 8,20,52 < /some/file |
while IFS=' ' read -r field1 field2 field3 field4; do
...
done
--
Todd Allen
Concurrent Computer Corporation
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- enhancement request: one or more spaces/tabs,
Todd Allen <=