Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Creating a Text file from other text file

조회 수: 1 (최근 30일)
Ebadur
Ebadur 2014년 7월 18일
마감: MATLAB Answer Bot 2021년 8월 20일
Suppose I have a Text file and I want to generate 100 text files from that one. In every text file only one number will be replaced, other will remain same. For Example, the main text file contains AAA BBB 1, the next should be AAA BBB 2, AAA BBB 3 and so on. How to do get that logic? Any type of suggestion would be appreciated.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 7월 18일
편집: Azzi Abdelmalek 2014년 7월 18일
out=regexp(sprintf('AAA BBB %d,',1:10),',','split')
out(end)=[]
%or
str='AAA BBB'
out=genvarname(repmat({str},11,1))
out(1)=[]
  댓글 수: 1
Ebadur
Ebadur 2014년 7월 18일
Can I send you a personal email if you dont mind?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by