- 积分
- 1501
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-8-6
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2015-4-14 22:19:32
|
显示全部楼层
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!这个是写的程序!!!!!!!!!!!
program main
implicit none
character(len=16) lon,lat,chen,A
integer,parameter:: m=161,n=22
real:: b1(m),b2(m)
character*10:: a1(m)
integer i,j,a2(m),loc
character*12 c(n)
character*12 filename
character*20 tmp
open (10,file="D:\150413\140930\140930.txt")
do j=1,n
read(10,*) c(j)
! write(*,*) c(j)
end do
close(10)
do j=1,n
write(filename,"(a12)")c(j)
open(101,file='D:\150413\140930\'//filename//'',status='old',form='formatted')
read(101,*) chen,A
!write(*,*)chen,A
do i=1,m
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
read(101,"(a20)")tmp
loc = index (tmp, ' ')
if (tmp(loc+1:loc+3) .ne. ' ') then
read(tmp(1:loc-1),*) a1(i)
read (tmp(loc+1:loc+3),"(i3)") a2(i)
else
read(tmp(1:loc-1),*) a1(i)
a2(i)=9999
end if
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
end do
close (101)
open (102,file='jwd.txt')
read(102,*) lon,lat
do i=1,m
read(102,*) b1(i),b2(i)
end do
close (102)
open (103, file=filename)
write(103,"(1x,A4,5X,A4,5X,A4,5X,A7)") lon,lat,chen,A
do i=1,m
write(103,"(f6.2,2x,f6.2,3X,a10,i5)") b1(i),b2(i),a1(i),a2(i)
end do
close(103)
end do
end
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
以上是读取写入程序,两个图片分别为错误提示和数据{:soso_e154:}
|
-
-
|