Re: Does this string processing work for you?
- From: "David Frank" <dave_frank@xxxxxxxxxxx>
- Date: Fri, 30 Sep 2005 10:26:45 GMT
Before this topic ends, I want to show a alternate method.
Below is also a easy 2 statement solution using a count_items function that
handles comma,blank item separators, and I just modified my existing 1
statement count_items function to handle commas along with blanks.
include "strings.f90" !
http://home.earthlink.net/~dave_gemini/strings.f90
! -------------------
program process_string
use string_functions
character(200) :: s = '1,2,3, 4 5 6 7, 8 9,10'
integer :: v(100), n
n = Count_Items(s)
read (s,*) v(1:n)
write (*,'(999i3)') v(1:n) ! = 1 2 3 4 5 6 7 8 9 10
end program
.
- References:
- Does this string processing work for you?
- From: David Frank
- Does this string processing work for you?
- Prev by Date: Re: declaring array arguments in subroutines
- Next by Date: Request for C2F.ZIP
- Previous by thread: Re: Does this string processing work for you?
- Next by thread: Re: Does this string processing work for you?
- Index(es):