LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-08-2008, 03:52 PM   #1
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Rep: Reputation: 30
Change all uppercase to lowercase with vi??


Can we change all uppercase characters to lowercase using vi, or any other technique may be easier?
 
Old 04-08-2008, 03:59 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,812
Blog Entries: 1

Rep: Reputation: 259Reputation: 259Reputation: 259
I'm using Vim, not Vi so you never know. But, guu will change all uppercase in a line to lower case. gUU goes the other way.

More commands here --> http://cross-lfs.org/~arowland/docs/vimtips.pdf
 
Old 04-08-2008, 04:16 PM   #3
prad77
Member
 
Registered: Mar 2008
Posts: 101

Rep: Reputation: 15
tr '[:upper:]' '[:lower:]' <file >newfile

Gentoo

Last edited by prad77; 04-17-2008 at 04:45 AM.
 
Old 05-06-2009, 04:32 PM   #4
Irenaeous
LQ Newbie
 
Registered: May 2009
Posts: 1

Rep: Reputation: 1
Change all uppercase to lowercase with vi?

Easy:

:%s/.*/\L&/

Conversely, :%s/.*/\U&/ will change all the characters to uppercase.
 
1 members found this post helpful.
Old 07-05-2013, 05:16 AM   #5
naga9711
LQ Newbie
 
Registered: Jul 2013
Posts: 1

Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by Irenaeous View Post
Easy:

:%s/.*/\L&/

Conversely, :%s/.*/\U&/ will change all the characters to uppercase.
Thanks-- This worked
 
Old 10-18-2017, 12:51 PM   #6
mralphawolf
LQ Newbie
 
Registered: Oct 2017
Posts: 1

Rep: Reputation: Disabled
Change upper/lower case at same time

Hello, silly question, how can these be combined so you change all upper case to lower case and all lower case to upper case at the same time, in the same text document.
 
Old 10-18-2017, 03:57 PM   #7
dave@burn-it.co.uk
Member
 
Registered: Sep 2011
Distribution: Puppy
Posts: 365

Rep: Reputation: 135Reputation: 135
I don't know of one.
I wrote a program many years ago to correctly format names and addresses. It was written in Pl/1 and ran under Windows 3.1 and higher. Though the highest version I tested it with was Vista.
I see no reason why it wouldn't work under the latest Windows if the right libraries were available.
It was also compiled and run on IBM mainframes.
 
Old 10-18-2017, 04:04 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,913

Rep: Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999
Using a C++ type language I'd or the characters with the relevant mask. Sorry, don't recall what it is but I do recall there's a mask you can or tochange case or xor to change to uppercase.
This was the first google result that looks familiar.
 
Old 10-18-2017, 08:38 PM   #9
MadeInGermany
Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 543

Rep: Reputation: 251Reputation: 251Reputation: 251
The ~ key toggles the case of the current character and steps to the next character.
To change a thousand characters, hit ~ a thousand times, or type
Code:
1000~
 
Old 10-18-2017, 10:00 PM   #10
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,375

Rep: Reputation: 240Reputation: 240Reputation: 240
Smile

Quote:
Originally Posted by MadeInGermany View Post
The ~ key toggles the case of the current character and steps to the next character.
To change a thousand characters, hit ~ a thousand times, or type
Code:
1000~
What would be the correct syntax to input that command against a text file?
 
Old 10-19-2017, 06:38 AM   #11
MadeInGermany
Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 543

Rep: Reputation: 251Reputation: 251Reputation: 251
Just seeing that ~ does not advance to the next line
 
Old 10-19-2017, 07:16 AM   #12
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,905

Rep: Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921
go to the beginning of the file and
Code:
1000g~~
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
UPPERCASE to lowercase command? pk21 Linux - General 4 06-12-2007 11:26 AM
Lowercase to Uppercase stellafrank Linux - Software 2 11-16-2006 06:46 AM
rename script won't change uppercase to lowercase on fat32 pwc101 Programming 4 09-27-2006 06:16 PM
Converting Uppercase to Lowercase AMMullan Linux - Software 6 10-18-2005 08:32 PM
Converting lowercase to uppercase noodle123 Programming 1 05-17-2002 03:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration