Reading .txt file of values separated by semicolon
18 ビュー (過去 30 日間)
古いコメントを表示
Austin Freeberg
2017 年 1 月 24 日
回答済み: the cyclist
2017 年 1 月 24 日
Hi,
I'm trying to open a file and put into an array a .txt file that is set up as follows: name1;name2;name3;etc
I tried creating some code that would open this file, read it, and put it into an array. However, it creates a 1x1 array with the entire string of names in one place. Is there a way to splitting these up?
fileName = fopen('data.txt')
C = textscan(fileName, '%s')
0 件のコメント
採用された回答
その他の回答 (1 件)
the cyclist
2017 年 1 月 24 日
Does this do what you want?
C = textscan(fileName, '%s','Delimiter',';')
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で String Parsing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!