Ive some textfiles which contains some colums seperated by a various number of spaces, but instead i need one single tab as a seperator. Any ways in Bash?
feedback
|
|
To convert sequences of more than one space to a tab, but leave individual spaces alone:
To do this for a number of files:
or
or
| |||
|
feedback
|
|
The easiest answer using only
If there are a variable number of columns, you can do this, but it will only work in
e.g.
produces:
(there is a tab in between each, but it's hard to see when I paste it here) You could also do it using sed:
tr:
| ||||
|
feedback
|
|
Try the following SED script:
Where <TAB> is pressing the TAB key. | ||||
|
feedback
|
|
You can use Example to replace one-or-more-spaces with one tab:
| |||||
feedback
|
