|
|
Re: How to Select Entire Row From Excel File Uisng Prompt?
Posted:
Nov 18, 2012 1:22 PM
|
|
You could spend time digging into the file to see how many columns of the specified row are actually used and then just extract those cells, but it may be just as quick to use a sledge hammer approach
try % Reading 2007 and 2010 files row = xlsread('myfile.xls',sprintf('A%d:XFD%d',rowNumber)); catch ME %#ok try % read 2003 files row = xlsread('myfile.xls',sprintf('A%d:IV%d',rowNumber)); catch ME rethrow(ME); end end
% Strip nans from the result % (This will strip all nans not just those at the end of the row.) data = row(~isnan(row));
Phil.
|
|