Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
 
 
主题工具 显示模式
旧 2007-12-21, 18:32   #2
elunxu
普通会员
 
注册日期: 2007-12-02
年龄: 44
帖子: 74
声望力: 19
elunxu 正向着好的方向发展
默认

没有出现楼主所说的问题。

x.txt
function findreplace(file,otext,ntext,varargin)
%FINDREPLACE finds and replaces strings in a text file
%
% SYNTAX:
%
% findreplace(file,otext,ntext)
% findreplace(file,otext,ntext,match)
%
% findreplace : This function finds and replaces strings in a text file
%
% file: text file name (with or without path)
% otext: text to be replaced (old text)
% ntext: replacing text (new text)
% match: either (1) for match case or (0) to ignore case
% default value is (1)
%
>> findreplace('D:\x.txt','%','a')

15 Changes Made & Saved Successfully

处理得到的结果:
function findreplace(file,otext,ntext,varargin)
aFINDREPLACE finds and replaces strings in a text file
a
a SYNTAX:
a
a findreplace(file,otext,ntext)
a findreplace(file,otext,ntext,match)
a
a findreplace : This function finds and replaces strings in a text file
a
a file: text file name (with or without path)
a otext: text to be replaced (old text)
a ntext: replacing text (new text)
a match: either (1) for match case or (0) to ignore case
a default value is (1)
a
elunxu 当前离线   回复时引用此帖
 


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 19:30


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.