Re: Does this string processing work for you?
- From: "David Frank" <dave_frank@xxxxxxxxxxx>
- Date: Thu, 29 Sep 2005 13:18:24 GMT
"Arjen Markus" <arjen.markus@xxxxxxxxxx> wrote in message
news:1127994635.662422.247740@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> But what happens with a loop like:
>
> read( s, *, err=1 ) ( v(i) ,i=7,100,3 )
>
> (By the way the final value of "i" with the Intel Fortran compiler
> on Linux is 103)
>
> Regards,
>
> Arjen
>
The task is to find a EASY way to process unknown #items from file record
strings.
Your bum-fuzzling artifice above is not pertinent to this task, but if you
HAVE to spread the items into the receiving array
below can do your 7,100,3 spreading
! -------------------
program process_string
character(200) :: s = '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17'
integer :: v(100), n
s(len_trim(s)+1:) = ' ' // char(0)
read (s,*,err=1) (v(7+(n-1)*3),n=1,size(v))
1 write (*,'(999I3)') n, v(1:n-1)
end program
18 0 0 0 0 0 0 1 0 0 2 0 0 3 0 0 4 0
.
- Follow-Ups:
- Re: Does this string processing work for you?
- From: *** Hendrickson
- Re: Does this string processing work for you?
- References:
- Does this string processing work for you?
- From: David Frank
- Re: Does this string processing work for you?
- From: Herman D . Knoble
- Re: Does this string processing work for you?
- From: David Frank
- Re: Does this string processing work for you?
- From: Arjen Markus
- Re: Does this string processing work for you?
- From: David Frank
- Re: Does this string processing work for you?
- From: Dan Nagle
- Re: Does this string processing work for you?
- From: David Frank
- Re: Does this string processing work for you?
- From: Arjen Markus
- Does this string processing work for you?
- Prev by Date: Re: NEWBIE QUESTION
- Next by Date: Re: NEWBIE QUESTION
- Previous by thread: Re: Does this string processing work for you?
- Next by thread: Re: Does this string processing work for you?
- Index(es):