%% Preview Data Before Importing Full Table
% First, create an import options object. Next, use the import options to get the first eight rows of the table, and then generate a preview showing only the variables of interest.
%
% Create an import options object for a file.

filename = 'outages.csv';
opts = detectImportOptions(filename);

%
% Preview the table.

preview(filename,opts)

%
% Select which variables to include in the preview and read operations.

opts.SelectedVariableNames = {'Region','OutageTime'};

%
% Preview the first eight rows and selected variables.

preview(filename,opts)

%
% Copyright 2012 The MathWorks, Inc.