Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Insert row in a text file-formating issues
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I have follwing question:
I have a "Mytext.txt" file which contains a formated table [20000X30]. It looks like:
1 2 3 4 .... 30/
2 2 3 4 .... 30/
................
20000 2 3 4...30/
I would like to insert a row after each row from the table such Mynewtext.txt" file should look like:
1 2 3 4 .... 30/
120 30/
2 2 3 4 .... 30/
120 30/
................
20000 2 3 4...30/
The row 120 30/ has to be formatted such that I have ten blanks, 120, again ten blanks and 30.
Thank you
댓글 수: 0
답변 (1개)
Christiaan
2015년 6월 17일
편집: Christiaan
2015년 6월 17일
Dear Ionut,
What you could do is use the import gui tool in MATLAB for importing text files. With this tool, you can determine how you want to import your data. It is even possible to generate a script to do this automatically. Documentation can be found here.
Once you have accieved this, you can just look at your importated mat file and modify it to your wish. (for example adding a line in your textfile) And once you are done, you can save it as a textfile again.
Kind regards, Christiaan
댓글 수: 1
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!