查看单个帖子
旧 2008-12-15, 10:40   #1
Rhent
初级会员
 
注册日期: 2008-11-06
年龄: 36
帖子: 4
声望力: 0
Rhent 正向着好的方向发展
默认 [求助]读入txt时空格丢失问题

程序段为:
fid1=fopen('input.txt','rt');
s=fscanf(fid1,'%s');
fclose(fid1);

加入input.txt中内容为:
Skip to content.Skip to bbc.co.uk navigation.Skip to bbc.co.uk search.The BBC is not responsible for the content of external internet sites.
结果为:
s=Skiptocontent.Skiptobbc.co.uknavigation.Skiptobbc.co.uksearch.TheBBCisnotresponsibleforthecontentofexternalinternetsites.

读入的txt文件为一段纯英文字符串,读入工作空间后空格丢失,用了多种读入函数(dlmread,fread等)均无法解决,请教高人。
Rhent 当前离线   回复时引用此帖