AWK: convert into lower or upper cases

In order to convert a bash variable to lower case with awk, just use this command:

If you want to convert the content of a file (called data.csv) to lower case:

Of course to convert into upper case, simply use the function toupper() instead of tolower().

Note also that a better tool to avoid issues with special characters might be the tr unix command:

This entry was posted in Linux and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.