I need to import time values in a given column to an array using textscan. I can't seem to be able to find the correct format spec to do this.
Attached is the file I am trying to import from. The row titled 'Start Time" is what I want. The values begin in row 22 column 2 and are in format (hh:mm:ss).
The import data tool uses the below format however gives me rounded values numerical values that are not helpful. How can I edit this to give me what I want
delimiter = ',';if nargin<=2startRow = 22;endRow = 22;endformatSpec = '%*s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%[^\n\r]';dataArray = textscan(fileID, formatSpec, endRow(1)-startRow(1)+1, 'Delimiter', delimiter, 'TextType', 'string', 'HeaderLines', startRow(1)-1, 'ReturnOnError', false, 'EndOfLine', '\r\n');
Best Answer