Data extraction from txt with special format

2 visualizaciones (últimos 30 días)
Win co
Win co el 1 de Oct. de 2014
Comentada: Win co el 2 de Oct. de 2014
Hello,
Given a following .txt file with 5 columns delimited by tab, I have difficulty at extracting these data in a matrix (double) where the 3rd column contains converted values in seconds.
ID DDD HH:MM:SS.mmmuuun PARA1 PARA2
1 0 01:05:04.9941480 0.0131 0.0000
In this example, in my matrix, the 3rd column has to be 1*3600+5*60+4.9941480. Could anyone help me to solve it please? Best regards, Winn

Respuesta aceptada

Image Analyst
Image Analyst el 1 de Oct. de 2014
Try the readtable() function:
t = readtable(fullFileName);
If that doesn't work, try textscan().
  1 comentario
Win co
Win co el 2 de Oct. de 2014
Thanks for your recommendation. I'm using Maltab2012b, "readtable" function does not exist. I've figured out how to solve this problem with textscan, maybe not optimal but it works as I wish. In sum, I seperate numeric data and string data. With the last one, I convert to numeric value.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Large Files and Big Data 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