查看单个帖子
旧 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 当前离线   回复时引用此帖