How to skip randomly occurring header lines using textscan
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I wish to use textscan to read a large text file have two tab separated numbers in each line. The problem is, once in a while, the file has a header line beginning with a '>' character. How do I use textscan to read the file skipping the header lines whenever they occur? I tried using fgetl and the code has been running for several hours and is still running! I know textscan will do it in seconds. If anybody knows a solution, please help.
댓글 수: 0
채택된 답변
Walter Roberson
2011년 12월 20일
Provided that the '>' does not occur otherwise, use 'CommentStyle', '>' as a textscan parameter/value pair, and it will ignore from the '>' to the end of the line.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import and Export에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!