Re: [Question:]How to split one file into 3/4 using fortran?
From: andy (andylcx_at_hotmail.com)
Date: 07/31/04
- Next message: Gary L. Scott: "Re: C objects [was Re: Is Itanium the first 64-bit casualty?]"
- Previous message: Stephen Fuld: "Re: C objects [was Re: Is Itanium the first 64-bit casualty?]"
- In reply to: David Frank: "Re: [Question:]How to split one file into 3/4 using fortran?"
- Next in thread: robin: "Re: [Question:]How to split one file into 3/4 using fortran?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Jul 2004 16:00:11 -0700
"David Frank" <dave_frank@hotmail.com> wrote in message news:<fJLMc.2907$kU5.241019@twister.tampabay.rr.com>...
> "glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message
> news:v7AMc.23761$8_6.5504@attbi_s04...
> > andy wrote:
> >
> >> I have a question about how to split a file following into 3
> >> different files.
> >
> > Unless this is a homework assignment, I would do it in awk.
> >
> > -- glen
> >
> >
>
> Its simple in Fortran without having to learn such awkward <pun> syntax..
>
> Pls show us how awkward (clumsy) your fav language (PL/I) would be
> handling this problem..
>
> ! ---------------
> program split ! split.txt -> split.1, split.2, etc.
> implicit none
> integer :: n = 0
> character :: prev = ' '
> character(80) :: line
> character(10) :: filename = 'split.xxx'
>
> open (1,file='split.txt') ! input file
>
> do
> read (1,'(a)',end=101) line
> if (line(1:1) == '#'.and.prev /= '#') then
> n = n+1 ; write (filename(7:),'(i0)') n ! next filename
> close (2) ; open (2,file=filename)
> end if
> write (2,'(a)') trim(line) ! output line
> prev = line(1:1) ! track line contents
> end do
> 101 stop
> end program
Hi, a simple question! What does "/= '#'" meaning in the sentence "if
(line(1:1) == '#'.and.prev /= '#') then". I guess this is a fortran 90
feature. I only learned the fortran 77 and am not familiar with for90.
And I did not find any explanation in the book <Fortran 90
programming>.
Thanks
- Next message: Gary L. Scott: "Re: C objects [was Re: Is Itanium the first 64-bit casualty?]"
- Previous message: Stephen Fuld: "Re: C objects [was Re: Is Itanium the first 64-bit casualty?]"
- In reply to: David Frank: "Re: [Question:]How to split one file into 3/4 using fortran?"
- Next in thread: robin: "Re: [Question:]How to split one file into 3/4 using fortran?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|