in reply to Howto convert hex to string

This data isn't hex, but decimal (according to man ascii anyway)

$> perl -e 'print pack("i*", $_) for(qw/84 67 49 67 83 50 79/)' TC1CS2O

If you have really hex-values, change i to h

perl -e 'print pack("h*", $_) for(qw/H E X V A L U E S/)'
for a closer look, read perldoc -f pack.

regards,
tomte


Hlade's Law:

If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.

Replies are listed 'Best First'.
Re: Re: Howto convert hex to string
by broquaint (Abbot) on Jun 27, 2003 at 09:06 UTC
    Or simpler still
    shell> perl -le 'print map chr, qw/84 67 49 67 83 50 79/' TC1CS2O
    And if you're dealing with hex values
    shell> perl -le 'print map { chr hex } qw/54 43 31 43 53 32 4f/' TC1CS2O
    See. map, chr and hex for more info.
    HTH

    _________
    broquaint