Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Read hex byte into character(1)

Adrian_F_1
Beginner
437 Views

I have a character variable of length 2, eg ch2 = '4f', which I want to read into a character variable of length 1, ch1, which must contain the ASCII representation of the 2-char string, ie. Z'4f'  ie. ch1='O'.  Is there an elegant way to do this in a READ / FORMAT statement?  Something like read(ch2,'(z2)') ch1?

0 Kudos
1 Reply
Adrian_F_1
Beginner
437 Views

Sorry my suggestion actually works, I mistyped it in my example!

0 Kudos
Reply