function [underlying_symbol,quote_datetime,root,expiration,strike,option_type,open1,high,low,close,trade_volume,bid_size,bid,ask_size,ask,underlying_bid,underlying_ask,number_of_exchanges,exchange,bid_size1,bid1,ask_size1,asknumber_of_exchanges] = importfile7(filename, startRow, endRow)
%IMPORTFILE1 Import numeric data from a text file as column vectors.
%   [UNDERLYING_SYMBOL,QUOTE_DATETIME,ROOT,EXPIRATION,STRIKE,OPTION_TYPE,OPEN1,HIGH,LOW,CLOSE,TRADE_VOLUME,BID_SIZE,BID,ASK_SIZE,ASK,UNDERLYING_BID,UNDERLYING_ASK,NUMBER_OF_EXCHANGES,EXCHANGE,BID_SIZE1,BID1,ASK_SIZE1,ASKNUMBER_OF_EXCHANGES]
%   = IMPORTFILE1(FILENAME) Reads data from text file FILENAME for the default selection.
%
%   [UNDERLYING_SYMBOL,QUOTE_DATETIME,ROOT,EXPIRATION,STRIKE,OPTION_TYPE,OPEN1,HIGH,LOW,CLOSE,TRADE_VOLUME,BID_SIZE,BID,ASK_SIZE,ASK,UNDERLYING_BID,UNDERLYING_ASK,NUMBER_OF_EXCHANGES,EXCHANGE,BID_SIZE1,BID1,ASK_SIZE1,ASKNUMBER_OF_EXCHANGES]
%   = IMPORTFILE1(FILENAME, STARTROW, ENDROW) Reads data from rows STARTROW through ENDROW of text file FILENAME.
%
% Example:
%   [underlying_symbol,quote_datetime,root,expiration,strike,option_type,open1,high,low,close,trade_volume,bid_size,bid,ask_size,ask,underlying_bid,underlying_ask,number_of_exchanges,exchange,bid_size1,bid1,ask_size1,asknumber_of_exchanges] = importfile1('UnderlyingOptionsIntervalsQuotes_60sec_2004.csv',2, 458461);
%
%    See also TEXTSCAN.

% Auto-generated by MATLAB on 2019/10/07 17:10:58

%% Initialize variables.
delimiter = ',';
if nargin<=2
    startRow = 2;
    endRow = inf;
end

%% Format for each line of text:
%   column1: categorical (%C)
%	column2: datetimes (%{yyyy-MM-dd HH:mm:ss}D)
%   column3: categorical (%C)
%	column4: datetimes (%{yyyy-MM-dd}D)
%   column5: double (%f)
%	column6: categorical (%C)
%   column7: double (%f)
%	column8: double (%f)
%   column9: double (%f)
%	column10: double (%f)
%   column11: double (%f)
%	column12: double (%f)
%   column13: double (%f)
%	column14: double (%f)
%   column15: double (%f)
%	column16: double (%f)
%   column17: double (%f)
%	column18: double (%f)
%   column19: double (%f)
%	column20: double (%f)
%   column21: double (%f)
%	column22: double (%f)
%   column23: double (%f)
% For more information, see the TEXTSCAN documentation.
formatSpec = '%C%{yyyy-MM-dd HH:mm:ss}D%C%{yyyy-MM-dd}D%f%C%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%[^\n\r]';

%% Open the text file.
fileID = fopen(filename,'r');

%% Read columns of data according to the format.
% This call is based on the structure of the file used to generate this code. If an error occurs for a different file, try regenerating the code from
% the Import Tool.
dataArray = textscan(fileID, formatSpec, endRow(1)-startRow(1)+1, 'Delimiter', delimiter, 'TextType', 'string', 'EmptyValue', NaN, 'HeaderLines', startRow(1)-1, 'ReturnOnError', false, 'EndOfLine', '\r\n');
for block=2:length(startRow)
    frewind(fileID);
    dataArrayBlock = textscan(fileID, formatSpec, endRow(block)-startRow(block)+1, 'Delimiter', delimiter, 'TextType', 'string', 'EmptyValue', NaN, 'HeaderLines', startRow(block)-1, 'ReturnOnError', false, 'EndOfLine', '\r\n');
    for col=1:length(dataArray)
        dataArray{col} = [dataArray{col};dataArrayBlock{col}];
    end
end

%% Close the text file.
fclose(fileID);

%% Post processing for unimportable data.
% No unimportable data rules were applied during the import, so no post processing code is included. To generate code which works for unimportable
% data, select unimportable cells in a file and regenerate the script.

%% Allocate imported array to column variable names
underlying_symbol = dataArray{:, 1};
quote_datetime = dataArray{:, 2};
root = dataArray{:, 3};
expiration = dataArray{:, 4};
strike = dataArray{:, 5};
option_type = dataArray{:, 6};
open1 = dataArray{:, 7};
high = dataArray{:, 8};
low = dataArray{:, 9};
close = dataArray{:, 10};
trade_volume = dataArray{:, 11};
bid_size = dataArray{:, 12};
bid = dataArray{:, 13};
ask_size = dataArray{:, 14};
ask = dataArray{:, 15};
underlying_bid = dataArray{:, 16};
underlying_ask = dataArray{:, 17};
number_of_exchanges = dataArray{:, 18};
exchange = dataArray{:, 19};
bid_size1 = dataArray{:, 20};
bid1 = dataArray{:, 21};
ask_size1 = dataArray{:, 22};
asknumber_of_exchanges = dataArray{:, 23};


