How do i convert my text file into a column array with the same format as it is in the text file ?

2 vues (au cours des 30 derniers jours)
I have a text file (attached with the question)i want to convert into an array (a column wise array) .I am not able to get the required result .
Whenever i am textscan or fscanf its converting the file into a huge line with characters ,hence not converting it into an array.I want to each line as a row in the array.
I will attach the code i wrote :
fid = fopen('TestLists.txt')
u = fscanf(fid,'%s');
Kindly find the Text file attached.

Réponse acceptée

KSSV
KSSV le 16 Avr 2019
fid = fopen('TestLists.txt','r') ;
S = textscan(fid,'%s','delimiter','\n') ;
fclose(fid) ;
S = S{1} ;
S{1} % first line
S{3} % third line....

Plus de réponses (0)

Catégories

En savoir plus sur Data Import and Export dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by