Import text data with multiple delimiters
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
J T
el 6 de En. de 2021
Respondida: Walter Roberson
el 6 de En. de 2021
Hello, I have a badly structure data set in a text file, something like this:
[9.29509929e+02 4.88661114e+06 5.01623751e+03], 122158005196.00102,
[9.29509929e+02 4.88661114e+06 5.01623751e+03], 122158005196.00102,
[9.29509929e+02 4.88661114e+06 5.01623751e+03], 122158005196.00102,
[9.29498501e+02 4.88676967e+06 5.01635996e+03], 122079659456.75313,
How should I import this as a N-by-4 array? I usually use importdata('foo.txt') but it wouldn't work directly with multiple delimiters.
0 comentarios
Respuesta aceptada
Walter Roberson
el 6 de En. de 2021
table2array(readtable(FILENAME, 'Format', '[%f %f %f], %f,'))
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Import from MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!