Re: string stuff



On Oct 7, 10:26 am, Bart Vandewoestyne
<MyFirstName.MyLastN...@xxxxxxxxxx> wrote:
On 2009-10-07, dpb <n...@xxxxxxx> wrote:



Any suggestions on how to do this?

idx = index(ps_string, 'pulse', back=.true.) + len('pulse')+1
left_str = ps_string(1:idx-1)
rite_str = ps_string(idx:len_trim(ps_string)

Sorry... i forgot to mention that the text 'pulse' can also be
something else and with a different length... so the above trick
doesn't work for me.

I didn't quite understand why you could not simply add a second

if (idx .eq. 0) then
idx = index(ps_string, 'somehthingelse', back=.true.) +len
('somethingelse')+1
....

i.e. if you don't find a 'pulse' then keep checking for the alternate
key words...
Regards,
Bart

--
        "Share what you know.  Learn what you don't."

.



Relevant Pages

  • Re: string stuff
    ... On Oct 7, 4:26 pm, Bart Vandewoestyne ... i forgot to mention that the text 'pulse' can also be ... you can then recombine the strings as you want ... (this will get rid of the white space between blocks of text) ...
    (comp.lang.fortran)
  • Re: string stuff
    ... Bart Vandewoestyne wrote: ... formatting is also arbitrarily chosen by the user. ... numbers after 'pulse' can vary. ... the two resulting strings are: ...
    (comp.lang.fortran)
  • Re: string stuff
    ... so the above trick ... i.e. if you don't find a 'pulse' then keep checking for the alternate ... preprocess the string to monocase it). ... I'm trying to tease out a bit of additional information... ...
    (comp.lang.fortran)