file scanning
조회 수: 6 (최근 30일)
이전 댓글 표시
I want to create a function that will scan the characters in a txt file one-by-one and when it encounters a certain character, it will skip the next 6 characters.
What would be the easiest/efficientist to do this?
thanks,
댓글 수: 1
Oleg Komarov
2012년 3월 23일
Scan and do what next? Or you mean import import all except those 6 after the specific one?
답변 (1개)
Jan
2012년 3월 23일
Str = fileread('FileName.txt');
match = strfind(Str, '$');
index = zeros(1, length(Str));
index(match) = 1;
index(match + 5) = -1;
index = cumsum(index);
Str(index(1:length(Str)) = [];
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Files and Folders에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!