Reading excel files ignoring first X rows

19 ビュー (過去 30 日間)
David C
David C 2012 年 4 月 24 日
New to matlab here so please excuse me if my questions are too simple
I'm trying to use the xlsread function, but have it omit the first x number of rows.
My spreadsheet contains 2-3 lines of random stuff before the actual header and data.
Can xlsread do that? or should I resort to textscan?
Thanks
  1 件のコメント
David C
David C 2012 年 4 月 24 日
thanks guys, I think I'll have to work around this issue

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

回答 (2 件)

Yersinio Jimenez
Yersinio Jimenez 2012 年 4 月 24 日
Is possible to specify data range to be readed in xlsread function third and fourth parameters. Does this solve your issue?

Walter Roberson
Walter Roberson 2012 年 4 月 24 日
Pass a "range" into xlsread().
I do not know of any way to specify "row 4 onwards" when the number of rows is unknown. People have posted methods of doing that, but if you do not fire up an activex object to handle the reading, figuring out the number of rows is fairly inefficient, and you might be best to just read everything and throw away the rows you do not want.

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by