作者AdonisLam (Adonis)
看板Fortran
标题[问题] 怎麽读取档案中的字串
时间Tue Nov 18 23:42:44 2014
请问各位大大
小弟想从档案中读取字串
再写入另一档案中
小弟是这样写的:
character(len=100) :: string
open(10, file='test.txt, status='old', action='read')
open(20, file='output.txt, status='unknow',action='write')
read(10,*) string
write(20,*) wtring
其中test.txt内容为:hello world
但怎麽改输出在output.txt中的都只有:hello
要怎麽样才能连空白忆起读取呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.122.57.38
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/Fortran/M.1416325367.A.3B9.html
※ 编辑: AdonisLam (140.122.57.38), 11/18/2014 23:44:16
1F:→ rex0707: read(10,"(A100)") string 11/19 19:42