Alternative solution albeit not totally Matlab, it worked pretty well here it seems--
Rather than trying to parse the humongous file when only want a small fraction therefrom, I used grep to filter out the lines with the desired area codes and then just read it. It took almost no time then for textscan to read the file and took only a few seconds for grep. Here's the command line for grep:
grep -E -f "fips.lst" 2016.q1-q4.singlefile.csv >fipsdata.csv
where the input file of wanted areas contained
where the order of the above is sorted as that will make for the fastest search since they are in numerical order in the file.
Then the code we had before works just fine excepting there's no header line in the output file...
fmt=[repmat('%q',1,3) '%*q %*q %q %q' repmat('%*q',1,4) '%f' repmat('%*q',1,8) '%f' '%*[^\n]'];
fid=fclose(fid); clear fid
>> whos data
Name Size Bytes Class Attributes
data 1x2 14115464 cell
'C1698' '0' '10' '2016' '1'
'C1698' '0' '10' '2016' '2'
'C1698' '0' '10' '2016' '3'
'C1698' '0' '10' '2016' '4'
It appears that while the other fields in the database that are strings other than the FIPS_AREA code are, in fact, numeric and could be converted or read as such. Not knowing what they really are other than year say, don't know if that would be the best course of action or to turn most of them into categorical variables, maybe? Anyway, if your analyses will be confined to relatively small groups of these IDs such as this, this may be a more fruitful way to attack reading the huge file rather than trying to deal with it all in Matlab. I'm sure we could work around it in one of the above manners, but this is pretty simple. I admit I've not tried the |dateaset| or other route as yet...
This is the version of grep for Win332 I'm using <tcharron grep.html>, I don't yet have a 64-bit system altho I'm sure there are bound to be ports for it I've not looked.
I'd forgotten CMD FINDSTR -- it actually has sufficient "oomph" to return the identical result in roughly the same time. I'm sure it's also built around a version of grep of course so not too surprising but I didn't recall it had the switches implemented it does...
C:\ML_R2014b\work\data> findstr -G:"fips.lst" 2016.q1-q4.singlefile.csv >lines2.dat
C:\ML_R2014b\work\data> dir line*.*
Volume in drive C is unlabeled Serial number is BC9D:AAD0
Directory of c:\ml_r2014b\work\data\line*.*
lines.dat 7134516 6/16/17 14:55 lines2.dat 7134516 6/16/17 15:54