Upper to Lower Case in Vi

Post date: Apr 12, 2013 9:20:13 PM

Oracle database all table names and schema name are in upper case but when you run the same file in Greenplum , all table names and schema names are in lower case.  For example I have a parameter files that contains schema in and table name for HR schema from oracle

oraclehr.txt

HR EMPLOYEES

HR DEPARTMENTS

HR LOCATIONS

In Greenplum we want it to be

hr employees

hr departments

hr locations.

to do this, you need to open the oraclehr.txt in vi and run

:%s/.*/\L&/

Conversely, :%s/.*/\U&/ will change all the characters to uppercase.

also

Open the file in vi

press Esc then

for uppercase: gggUG

for lowercase: ggguG