Selected Ways to Convert Tabs to Spaces from #'d items below from: http://mlawire.blogspot.com/2009/07/convert-tabs-to-spaces.html Posted 26th July 2009 by mla for use on Unix/Linux/OSX - found June 2016 -------------------------------------------------------------------------------------------- NOTE: the tab is represented by "\t" (to replace tab use #6b below) changing tabs to 4 spaces in vi, edit/create: .exrc set tabstop=4 shiftwidth=4 expandtab syntax off -------------------------------------------------------------------------------------------- #1 expand/unexpand utilities: expand < input.txt > output.txt #2 Sed: sed 's/\t/ /g' < input.txt > output.txt #3 Awk: awk '{ gsub(/\t/, " "); print }' < input.txt > output.txt #4 Perl perl -pe 's/\t/ /g' < input.txt > output.txt #6a Vim editor: :set expandtab ; :%retab! #6b Vim editor: :%s/\t/ /g #8 cut: cut -f1- --output-delimiter=' ' < input.txt > output.txt -------------------------------------------------------------------------------------------- |
![]() Wagoneers FULL SIZE JEEPS JeepMeister "Jeep is America's -Enzo Ferrari MeisterTech Diesels + |
One Page Overview![]() Intro to Linux ![]() |
|
at Midway Auto on SR9 in Snohomish, or at Northland Diesel in Bellingham, WA |