Can I use awk to convert all the lower-case letters into upper-case?
I have a file mixed with lower-case letters and upper-case letters, can I use awk
to convert all the letters in that file into upper-case?
Solution 1:
Try this:
awk '{ print toupper($0) }' <<< "your string"
Using a file:
awk '{ print toupper($0) }' yourfile.txt
Solution 2:
You can use awk
, but tr
is the better tool:
tr a-z A-Z < input
or
tr [:lower:] [:upper:] < input
Solution 3:
Something like
< yourMIXEDCASEfile.txt awk '{print toupper($0)}' > yourUPPERCASEfile.txt