using sed or gsub to substitute characters!

Is there a way to substitute the URL-encoding references of ( & and ` ) with their actual appearance? for example....
%26 is &
say I want to convert every %26 in my file to &.....

awk '{gsub(/%26/,"&");print}' 

Is there a way to do this?

I also want to be able to convert ` too!

& is the pattern space. \& is the character "&". \ is called "escape" it means take the next character literally not as a special character or a metacharacter.

sed /%26/\&/g' 

is what it seems you are looking for

1 Like

Oh, yeah that makes a whole lot of sense.. thank you!

awk '{gsub(/%26/,"\\&");print}' infile