Expand

The expand command converts tabs in the file to spaces. Let's use the same example we used in the section "Replacing Blank Lines and Tabs'':

[email protected]:~> cat morefruits kiwi mango pear quince [email protected]:~> cat -T morefruits kiwi'Imango pear quince cat morefruits | expand | cat -T kiwi mango pear quince

By piping the contents of the file through the expand command, you have converted the tabs to spaces. The output of cat -T shows that the tabs have gone away. This is a convenient way of tidying up a file that contains white space that is a random mixture of tabs and spaces.

Was this article helpful?

0 0

Post a comment