I have a table of data in form of .txt file, I have imported using the textscan function,now it is taking whole row of data as a string, what if I want to access to each word individually,Please let me know with alternatives ,Thanks
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Aditya
el 17 de En. de 2014
Comentada: Aditya
el 17 de En. de 2014
Name Rank Class Average
Jhon 2 09 70
Jhon 1 09 90
If this is the table for example, How to get the unique word out of the rows??? How do I compare bot and Output should be 1, because rank column data is different, 2 and 1,since 1 comes first in row, I should name it as key.
0 comentarios
Respuesta aceptada
Friedrich
el 17 de En. de 2014
Editada: Friedrich
el 17 de En. de 2014
Hi,
you can use
fid = fopen('data.txt','r')
header = textscan(fid,'%s%s%s%s',1,'delimiter',' ')
data = textscan(fid,'%s%f%f%f','delimiter',' ')
fclose(fid)
to read in the data. Then the variable data reflects the table structure of your file. So data{1} gives the first column and data{1}(2) would give the second entry in the first column
Más respuestas (0)
Ver también
Categorías
Más información sobre Large Files and Big Data en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!