I am trying to find/write something that will take a data file that has some data sets in it and some text, names of data sets; and give me only the data, without the text, such that I can work with it further (assign a specific column to do a specific thing). How do I get rid of the text? I have tried having a look at inputparser, but have a hard time understanding how I can implement it, or am I looking at the wrong thing?

 採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 11 月 17 日

0 投票

It depends. If the contents in the text file have a consistent format, many times using d=importdata('DataFile.txt') is sufficient to put the numerical data and text data aside. You can even use d=uiimport to go through it once manually and have the option to generate the code for it so you can apply it to other similar files.
If the format is not consistent, using textscan(fid,'%f') can skip the text strings.

1 件のコメント

Victor Buza
Victor Buza 2011 年 11 月 17 日
Thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by