Skip to content

Convert ASCII string to Hex in R (vice versa)

4 messages · Dieter Menne, Gundala Viswanath

#
Gundala Viswanath <gundalav <at> gmail.com> writes:
Re: Convert ASCII string to Hex in R (vice versa)

Difficult to understand what you want: could be

x = 32
(b = sprintf("%x",x) )

Also check hexmode/as.hexmode

Dieter
#
Dear all,


For example I have the following ASCII strings:
Each character in the above string represent a hexadecimal value.
I want to translate those string into an array (of size == string length)
which contain hexadecimal conversion.

as.hexmode doesn't seem to do the job.

Please advice.

- Gundala Viswanath
Jakarta - Indonesia



On Mon, Dec 22, 2008 at 4:44 PM, Dieter Menne
<dieter.menne at menne-biomed.de> wrote:
#
Gundala Viswanath <gundalav <at> gmail.com> writes:
Trying again, simplified

ascii_str  <- "ORQ>IK"
ascii_str2 <- "FDC"

What do you want as output in both cases? I can partially understand the second
case, but not the first.

Dieter