MATLAB: Read file names of files beyond a specific size into a vector

linux

i have a bunch ('n') of files named in the following way
asdfxxxxxx_pqrs.txt
where xxxxxx stands for 6 digit zero padded number
ex : xxxxxx can be any of 000000 000001 000002 000003 . .
Of these files, all of ~136b but rest of not. I need to read the numbers (without zero padding) of those files that are larger than 136b into a vector

Best Answer

If "136b" means a file size of 136 Bytes:
list = dir(fullfile(YourPath, 'asdf??????_pqrs.txt')
FileSize = [list.bytes];
FileName = {list(FileSize > 136).name};
Worm = sprintf('%s*', FileName{:});
Number = sscanf(Worm, 'asdf%d_pqrs.txt*');