Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change case 1

Status
Not open for further replies.

Ambatim

Programmer
Feb 28, 2002
110
IN
In vi, how can I change the case(from uppercase to lower or vice-versa), of all characters
in particular lines, say from line 10 to line 100 ??

If not possible in vi can I do it outside of vi using any commmand ???

Thanks in advance
Mallik
 
awk '{if (NR>=10 && NR<=100) print toupper($0); else print $0 }' < file1 > file2
 
cheating...... ;)

btw:

:2,200!tr '[a-z] '[A-Z]'

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
To convert a range to all uppercase or lowercase, use

10,100s/.*/\U&/

or

10,100s/.*/\L&/


CaKiwi

&quot;I love mankind, it's people I can't stand&quot; - Linus Van Pelt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top