Help! reformat the data file
From: chester (chesterliu_at_hotmail.com)
Date: 03/30/04
- Next message: Gary L. Scott: "Re: To "TAB" or not to "TAB""
- Previous message: John Harper: "Re: DIMENSION (N,*)"
- Next in thread: Richard Maine: "Re: Help! reformat the data file"
- Reply: Richard Maine: "Re: Help! reformat the data file"
- Reply: glen herrmannsfeldt: "Re: Help! reformat the data file"
- Reply: David Frank: "Re: Help! reformat the data file"
- Reply: beliavsky_at_aol.com: "Re: Help! reformat the data file"
- Reply: jan van oosterwijk: "Re: Help! reformat the data file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Gary L. Scott: "Re: To "TAB" or not to "TAB""
- Previous message: John Harper: "Re: DIMENSION (N,*)"
- Next in thread: Richard Maine: "Re: Help! reformat the data file"
- Reply: Richard Maine: "Re: Help! reformat the data file"
- Reply: glen herrmannsfeldt: "Re: Help! reformat the data file"
- Reply: David Frank: "Re: Help! reformat the data file"
- Reply: beliavsky_at_aol.com: "Re: Help! reformat the data file"
- Reply: jan van oosterwijk: "Re: Help! reformat the data file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|