how to split these char format into lines

5 visualizaciones (últimos 30 días)
Yu Li
Yu Li el 17 de Jul. de 2020
Comentada: Yu Li el 17 de Jul. de 2020
I have a char format data which is read from the last several lines of a file, from Linux system, by command provide by this answer:
however, I failed to find the way to split them into lines, I tried 'split' function with different deliminter such as '/t','/n', etc., but all failed.
could anyone give me some suggestions? please see attahce file.
Thanks!
Yu

Respuesta aceptada

Sindar
Sindar el 17 de Jul. de 2020
Editada: Sindar el 17 de Jul. de 2020
ed: Matlab has a built-in function
w_split = splitlines(w);
Here's a trick: I don't know what the delimiter between lines is, but I know where it is (with a little scanning), so I can extract it.
tmp=w(117)
tmp =
'
'
w_split = split(w,tmp);

Más respuestas (1)

Walter Roberson
Walter Roberson el 17 de Jul. de 2020
regexp(w, '\r?\n', 'split')

Categorías

Más información sobre Logical 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!

Translated by