[问题] 怎么读取档案中的字串

楼主: AdonisLam (Adonis)   2014-11-18 23:42:44
请问各位大大
小弟想从档案中读取字串
再写入另一档案中
小弟是这样写的:
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
要怎么样才能连空白忆起读取呢?
作者: rex0707 (我就是我)   2014-11-19 19:42:00
read(10,"(A100)") string

Links booklink

Contact Us: admin [ a t ] ucptt.com