Reading .txt file of values separated by semicolon
30 次查看(过去 30 天)
显示 更早的评论
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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!