- 积分
- 1395
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-7-12
- 最后登录
- 1970-1-1

|

楼主 |
发表于 2013-8-4 13:42:28
|
显示全部楼层
本帖最后由 qxjy123 于 2013-8-4 13:46 编辑
感谢zira127 跟 深深 回复
确实能读出来了。编辑的话还不能。
我是想弄成二维字符数组。一个字符一个字符的读。
这样的话也好编辑。就是想把“/”"=""X"都弄成0
但是我在zira127的基础上修改成二维数组时。却显示读错误。
哪位大大能否在帮忙一下呢。
program a
implicit none
character (len=700) :: cha(14,47)
integer :: i,j
open (10,file='a.txt',form='formatted')
do i=1,14
read(10,'(a)') (cha(i,j),j=1,47)
if (cha(i,j).eq."/") then
cha(i,j)=0
endif
if (cha(i,j).eq."=") then
cha(i,j)=0
endif
if (cha(i,j).eq."X") then
cha(i,j)=0
endif
print*,cha(i,j)
enddo
close(10)
end program a
|
|