Compare .txt to a string.
古いコメントを表示
How can you compare each line of a .txt file to a string?
採用された回答
その他の回答 (1 件)
Guillaume
2015 年 2 月 23 日
filelines = strsplit(fileread('sometextfile'), '\n');
issamestring = strcmp(filelines, 'stringtomatch')
2 件のコメント
per isakson
2015 年 2 月 23 日
Use strtrim to avoid trailing space of the text file.
Guillaume
2015 年 2 月 23 日
That's assuming you don't want to compare the spaces.
カテゴリ
ヘルプ センター および File Exchange で String Parsing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!