ramblinpeck has asked for the wisdom of the Perl Monks concerning the following question:
Trying to convert all the hex chars in a file to something I can read, from %61 to a for example
currently I have:
perl -i.bak -pe 's/\%([0-7][0-9-A-F])/char(hex($1))/g' <filename>
but this is just giving me a file with 'char(hex(61))' in place of '%61' instead of 'a'. Gotta be simple, but I can't for the life of me figure it out. Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Command Line Regex
by saintmike (Vicar) on Apr 07, 2006 at 00:18 UTC | |
|
Re: Command Line Regex
by graff (Chancellor) on Apr 07, 2006 at 04:35 UTC | |
by parv (Parson) on Apr 07, 2006 at 05:01 UTC | |
|
Re: Command Line Regex
by parv (Parson) on Apr 06, 2006 at 23:33 UTC | |
|
Re: Command Line Regex
by polettix (Vicar) on Apr 07, 2006 at 00:22 UTC | |
by parv (Parson) on Apr 07, 2006 at 00:51 UTC | |
by polettix (Vicar) on Apr 07, 2006 at 14:16 UTC | |
by parv (Parson) on Apr 07, 2006 at 16:19 UTC | |
|
Re: Command Line Regex
by aquarium (Curate) on Apr 07, 2006 at 11:31 UTC | |
|
Re: Command Line Regex
by Andrew_Levenson (Hermit) on Apr 08, 2006 at 21:13 UTC |