Convert content in text file to upper case or lower case

Given a text file we can convert content in it to upper case or lower case. Following are some ways to achieve it.

To upper case conversion:

With dd:

$ dd if=input.txt of=output.txt conv=ucase

With tr:

$ tr '[:lower:]' '[:upper:]' < input.txt > output.txt

To lower case conversion:

With dd:

$ dd if=input.txt of=output.txt conv=lcase

With tr:

$ tr '[:upper:]' '[:lower:]' < input.txt > output.txt
Advertisements

One comment on “Convert content in text file to upper case or lower case

  1. Pingback: Ubah isi file jadi lowercase atau uppercase « NurHidayat dot net

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s