Hi,
Greetings for the day !
I am trying to read a number of entries from a string where I don't know how many spaces will be there in between each entries and I have hexadecimal numbers to read from the string so I can't use unformatted read.
e.g. string -> 3 c 2cfb 0 d e
e.g. another sting -> 3 c 2cfb 0 d e
Currently I read the entries in character variables and then read hexadecimal numbers from these character variables. some like this
read (string,*) (string_entries(i),i=1,6)
do i=1,6
read(string_entries(i),'(z)')a(i)
end do
I was wondering if there is any way by which I can read directly these entries from string.
Thanks,
Jags
Greetings for the day !
I am trying to read a number of entries from a string where I don't know how many spaces will be there in between each entries and I have hexadecimal numbers to read from the string so I can't use unformatted read.
e.g. string -> 3 c 2cfb 0 d e
e.g. another sting -> 3 c 2cfb 0 d e
Currently I read the entries in character variables and then read hexadecimal numbers from these character variables. some like this
read (string,*) (string_entries(i),i=1,6)
do i=1,6
read(string_entries(i),'(z)')a(i)
end do
I was wondering if there is any way by which I can read directly these entries from string.
Thanks,
Jags