How to write specific lines of a text file into the several output files in certain defined places. ( rephrased version)
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello-- I was asked to rephrase my question in order to make it more useful to others! Please assume we have a large text file, I need to read a specific line in every 10 lines of the text file and write that line in another text file at the defined location of (A,B).
Please note for every 10 lines of the input file we need a distinct and separated output file. I hope this question finally get an answer :D Best,
댓글 수: 0
답변 (1개)
Walter Roberson
2015년 5월 6일
Have a look at textscan() using the N option to limit the number of lines you input. You can search for my contributions that mention textscan() as I have given several examples in the past.
As you have a large number of columns, you may wish to construct the format. See for example http://www.mathworks.com/matlabcentral/answers/27882-unable-to-import-data-with-textscan#comment_60999
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!