Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#2 |
普通会员
注册日期: 2007-12-02
年龄: 44
帖子: 74
声望力: 19 ![]() |
![]()
没有出现楼主所说的问题。
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 |
![]() |
![]() |