I also tried to extract the first 800 Trips (about 1800 Trips in total).
clear;clc;
data='D:\Umich\eBlueBus_2019 Summer\UMTRI data\SQLDataExport.txt';
% data='D:\Umich\eBlueBus_2019 Summer\Simulation\Trip_11to12_0702.txt';
ds = tabularTextDatastore(data);
ds.ReadSize=5000000;
ds.SelectedVariableNames={'Trip','GpsSpeed'};
ds.SelectedFormats={'%f','%f'};
t_array=tall(ds);
A=matlab.tall.transform(@reduce_fcn,t_array,'OutputsLike',{(table(1,1,'VariableNames',{'Trip','Spd'}))});
B=gather(head(A,800));
And, I could successfully run the code and get a 800 by 2 answer in table. However, as I tried to extract the first 1000 Trips, i.e.
B=gather(head(A,1000));
I got a similar error again.
Error using matlab.io.datastore.TabularTextDatastore/readData (line 77)
Mismatch between file and format character vector.
Trouble reading 'Numeric' field from file (row number 258461, field number 2) ==>
Trip,Time,GpsTime,GpsWeek,GpsHeading,GpsSpeed,Latitude,Longitude,Altitude,NumberOfSats,Differential,FixMode,Pdop,GpsBytes,UtcTime,UtcWeek\n
Learn more about errors encountered during GATHER.
Error in matlab.io.datastore.TabularDatastore/read (line 120)
[t, info] = readData(ds);
Error in tall/gather (line 50)
[varargout{:}, readFailureSummary] = iGather(varargin{:});
Error in UMTRI_data (line 21)
B=gather(head(A,1000));
Caused by:
Reading the variable name 'Trip' using format '%f' from file: 'D:\Umich\eBlueBus_2019
Summer\UMTRI data\SQLDataExport.txt' starting at offset 2852126774.