How to numbers and text to a matrix

I have a .txt that have numbers and text separated with ','. I need to separate them into a matrix. ¿How i do that? An example of the file:
8,1pol Pausa L2,,592,0
39,1pol Pausa L3,,593,0
40,85D,,65520,0
50.0
1
1000.000000,984
23/09/2012,07:19:20.609000

Answers (1)

Image Analyst
Image Analyst on 4 Jan 2013
Because your file has lines that change so much from one line to the next, you're going to have to read it with fgetl() and then examine the string to find out what kind of string it is. Maybe you can do that by counting commas, colons, and slashes. Then once you know what kind of string it is, you can use a sscanf() or textscan() with the proper format string to extract the numbers, times, dates, and strings out of it.

This question is closed.

Asked:

on 4 Jan 2013

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!