Awk and gawk lowercase

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
billrich
Posts: 70
Joined: 24 Apr 2012 05:36
Location: USA

Awk and gawk lowercase

#1 Post by billrich » 22 Nov 2012 10:27

Code: Select all

echo %1 | awk {"print tolower($_)"}
echo %1 | gawk {"print tolower($_)"}


Output:
C:\test>awkgawk.bat ABC

C:\test>echo ABC | awk {"print tolower($_)"}
abc

C:\test>echo ABC | gawk {"print tolower($_)"}
abc


C:\test>echo abc | awk {"print toupper($_)"}
ABC

C:\test>echo abc | gawk {"print toupper($_)"}
ABC

Awk is one of the super efficient commands invented by ATT in the 1960s.
All these super efficient commands are available for windows.
Awk and gawk toupper and tolower case is more efficient and easier to use than most other case commands
Last edited by billrich on 22 Nov 2012 11:07, edited 2 times in total.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Awk and gawk lowercase

#2 Post by foxidrive » 22 Nov 2012 10:32

Why don't you explain what you are doing in a paragraph, and say why it is a good idea.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Awk and gawk lowercase

#3 Post by Squashman » 22 Nov 2012 11:01

And as usual you don't explain that these commands are not native to Windows.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Awk and gawk lowercase

#4 Post by foxidrive » 22 Nov 2012 16:07

Awk and gawk can do so much more too. They have their own scripting language which is very powerful.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Awk and gawk lowercase

#5 Post by Squashman » 22 Nov 2012 16:30

foxidrive wrote:Awk and gawk can do so much more too. They have their own scripting language which is very powerful.

Can't argue that. I learned scripting on Linux long before I started with batch. I am sure there is a few different ways to do upper and lower case with diffeent NIX based utilities. Pretty sure TR and SED could probably do it as well.

Post Reply