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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

USING SED OR VI TO CHANGE CASE

Status
Not open for further replies.

johngiggs

Technical User
Oct 30, 2002
492
US
I have forgotten how to change all uppercase letters in a file to lowercase using vi and sed. Can someone please refresh my memory?

Thanks,

John
 
vi

:%s/.*/\L&/

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
Can someone please tell me how to do it with sed? I think it's something like:

sed 's/[A-Z]/[a-z]/g'

Thanks,

John
 
try

y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/

Check my typing to make sure I got all the letters on order

or use

tr '[A-Z]' '[a-z]'

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
tr '[A-Z]' '[a-z]' < file.txt

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
or awk '{print tolower($0)}' inputfile >outputfile

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top