Reading .txt file of values separated by semicolon
26 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Austin Freeberg
le 24 Jan 2017
Réponse apportée : the cyclist
le 24 Jan 2017
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 commentaires
Réponse acceptée
Jorge Mario Guerra González
le 24 Jan 2017
C = textscan(fileName, '%s','Delimiter',';')
0 commentaires
Plus de réponses (1)
the cyclist
le 24 Jan 2017
Does this do what you want?
C = textscan(fileName, '%s','Delimiter',';')
0 commentaires
Voir également
Catégories
En savoir plus sur Whos dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!