How do I import a list with 30 rows and 5 columns from a notepad file? The column has both strings and floats.

I want to store the list in an array. A sample row looks like this
BL - A - 0.02 - 20 - Corrective
Using the Import wizard, or the textscan, I was not able to read the above code. It threw me error saying it is not importable.
Please suggest me the method for this.

1 Comment

Please post more lines, such that we can see, what can be used as a pattern and what is varying.

Answers (1)

Try looping with fgetl() and then using strfind() to find the "valid" lines of text that you want to use sscanf() on.

This question is closed.

Asked:

on 10 Apr 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!