Help! reformat the data file

From: chester (chesterliu_at_hotmail.com)
Date: 03/30/04


Date: 30 Mar 2004 21:04:29 GMT

Hey guys here:
I have a data file needs to be reformatted. And I wrote a fortran program
but it does not work. Anyone can tell me where goes wrong? Thanks in
advance!

The data needs reformat as follow:
1 -32 34 12 23 -445 21 2 32 23
2 32 2 23 -445 212 32 23 2 -23
. . .
. . .

The format I need:
1
-32
34
12
23
-445
212
32
23
4
2
32
2
23
-445
212
32
23
2
-234
.
.
.
I wrote a fortran 90 program by myslef but it does not work.

Program transform
implicit none
integer :: A
dimension :: A(10)
integer :: I
open(4,file="old.dat",status="unknown")
do I=1,10
read(4,100)
A(I),A(I+1),A(I+2),A(I+3),A(I+4),A(I+5),A(I+6),A(I+7),A(I+8),A(I+9)
end do
100 format(I7,I7,I7,I7,I7,I7,I7,I7,I7,I7)
open(5,file="new.dat",status="unknown")
do I=1,10
write (5,200) A(I)
end do
200 format(I7)
close(4)
close(5)
end



Relevant Pages

  • Re: Help! reformat the data file
    ... > I have a data file needs to be reformatted. ... And I wrote a fortran program ... > The data needs reformat as follow: ... If you want to explicitly specify the format (which I do not ...
    (comp.lang.fortran)
  • Re: Help! reformat the data file
    ... > I have a data file needs to be reformatted. ... And I wrote a fortran program ... > The data needs reformat as follow: ... 1st name dot lastname at wanadoo dot nl ...
    (comp.lang.fortran)
  • Re: Help! reformat the data file
    ... > Hey guys here: ... > I have a data file needs to be reformatted. ... And I wrote a fortran program ... > The data needs reformat as follow: ...
    (comp.lang.fortran)