1845821 Members
3688 Online
110250 Solutions
New Discussion

Re: Scripting Awk

 
SOLVED
Go to solution
Arman Mahboobi
Advisor

Scripting Awk

Hi,
Iam executing the following awk command to replace all occurrances of the control y character from the inputfile.

awk '{ gsub("^Y","") ; print $0 }' <$inputfile >$outfile.fs

This command is not removing the ^Y character.

Attached is the inputfile.


3 REPLIES 3
Solution

Re: Scripting Awk

Are you typing the "^" and the "Y" as 2 separate characters? If so, then this is not really control-Y. When you are typing the awk script, use control-v then control-y. You should then see "^Y", but it's really the control character.

Regards,

Rich
Patrick Chim
Trusted Contributor

Re: Scripting Awk

Hi,

How do you type the control-Y ?

Do you just type "Shift-6" and "Y" ? If so, this is only 2 standlone character but not the control-Y.

What you need to do is press the control key but not release it, then press v and then y, you will then see the '^Y' will pop up at the same time. Then release your control button and all is OK.

Regards,
Patrick
Arman Mahboobi
Advisor

Re: Scripting Awk

Thanks guys, a replacement of original controly to the one specified has done the trick.

Cheers