Re: How to quote the " character in a format statement?



In article <c706bb0b-6fc4-409f-b487-8519cf2326ac@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Mirko.Vukovic@xxxxxxxxx writes:
Hi,

This is a follow-up on my previous post, as it relates to generating
valid TecPlot files.

Given a vector of strings, I need to print out a string of the
following form (with the quote characters in it).
"string1" "string2" "string3"

I was trying along the lines of
"4('magic'A5'magic')"
but I could not quite figure out what the magic would be.

My other alternative is to modify the string's by prepending and
appending the quotes.

Any other opinions?

character(len=5) :: s = 'abcde'
write(*,'(A)') '"' // trim(s) // '"'
write(*,1) trim(s)
1 format('"',A,'"')
end


--
Steve
http://troutmask.apl.washington.edu/~kargl/
.



Relevant Pages

  • How to quote the " character in a format statement?
    ... This is a follow-up on my previous post, ... valid TecPlot files. ... Given a vector of strings, I need to print out a string of the ... following form (with the quote characters in it). ...
    (comp.lang.fortran)
  • Re: Why cant I xor strings?
    ... follow-up discussion so far!) ... > two strings are similar, I don't see why xor for strings shouldn't be ... Am I missing something? ...
    (comp.lang.python)