Re: opening char variable data file



"Richard Maine" <nospam@xxxxxxxxxxxxx> wrote in message
news:1i6ubud.csdpth15org8fN%nospam@xxxxxxxxxxxxxxxx

Stripping quotes is trivial, but I'm not feeling like writing sample
code for it right now. One might want to include a check to see whether
the string had quotes or not.

C:\gfortran\clf\strip_me>type strip_me.f90
program strip_me
implicit none
character quoted_string*(80), stripped_string*(80)

quoted_string = '"""A quoted string"""'
read(quoted_string, *) stripped_string
write(*,*) 'Quoted string: ', trim(quoted_string)
write(*,*) 'Stripped string: ', trim(stripped_string)
quoted_string = stripped_string
read(quoted_string, *) stripped_string
write(*,*) 'Quoted string: ', trim(quoted_string)
write(*,*) 'Stripped string: ', trim(stripped_string)
end program strip_me

C:\gfortran\clf\strip_me>c:\gfortran\win64\bin\x86_64-pc-mingw32-gfortran
strip_
me.f90 -ostrip_me

C:\gfortran\clf\strip_me>strip_me
Quoted string: """A quoted string"""
Stripped string: "A quoted string"
Quoted string: "A quoted string"
Stripped string: A quoted string

--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end


.


Quantcast