how to count for whitespace symbol occurrences in a .txt file?
이전 댓글 표시
i found a way to read the .txt file and count the symbols using this code:
v=textread('FF7.m','%c'); count=length(strfind(v,'(symbol)'));
but i cant find a way to count the whitespaces, space, breaks, or tabs. in addition, since the input should be in script, i cant put the single quotation in the script. i also need to count the ' symbol.
can someone help me? any help will be very appreciated. thank you in advance!
채택된 답변
추가 답변 (1개)
Walter Roberson
2013년 3월 9일
'''' is a quoted single-quote.
You may wish to consider using ismember().
Also,
newline = sprintf('\n');
cr = sprintf('\r');
tab = sprintf('\t');
카테고리
도움말 센터 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!