Find and replace “tabs” using search and replace in nano

nanoregular expressiontext processing

How can I search and replace horizontal-tabs in nano? I've been trying to use [\t] in regex mode, but this only matches every occurrence of the character t?

…just been using sed 's/\t//g' file which works fine, but I would still be interested in a nano solution.

Best Answer

In nano to search and replace:

  1. Press Ctrl + \
  2. Enter your search string and hit return
  3. Enter your replacement string and hit return
  4. Press A to replace all instances

To replace tab characters you need to put nano in verbatim mode: Alt+Shift+V. Once in verbatim mode, you can type any character in it'll be be accepted literally when in verbatim mode, then hit return.

References

Related Question