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(file.txt,A,1,1)或者findreplace(file.txt,A,1,0)
你可以写个小程序试验一下,或者help findreplace