Showing posts with label Vi Editor. Show all posts
Showing posts with label Vi Editor. Show all posts

Jun 22, 2011

Converting Unix to Windows and back


 In vim, use :set ff=unix to convert to Unix; use :set ff=dos to convert to Windows.

Remove ^M characters at end of lines in vi


:%s/{Ctrl+V}{Ctrl+M}//{Enter}

Oct 1, 2010

Search and Replacing digits/integers

Replacing with out length restriction :=> :%s/\(\d\+\)/VALUE(\1)/g


Replacing with length restriction :=> :%s/\(\d\{10}\)/VALUE(\1)/g

Replacing space with tab

:%s/\s\+$/\t/g