Unfortunately, can't do it with standard Matlab i/o formatting strings; they just don't honor the fixed width, blank-delimited fields w/o at least one blank. Sad and pathetic and imo utterly unacceptable but that's just the way it is.
If you can't write the data files in another format that has delimiters, you've one of several choices...
a) read the whole file as character array and do character substitution to insert delimiters and then parse the modified array (textscan, say),
b) read a line at a time and parse individual fields w/ sscanf or the like. Something like
l=fgetl(fid); % read a line
resnum=[resnum;sscanf(l(1:5),'%d');
resname=[resname;sscanf(l(6:10),'%s');
...etc., ...
When you get past the character data you can then use an array and parse the six numeric fields together. Or, lastly,
c) see if regular expressions will actually honor a field width--I'm not conversant enough with it to know otomh...
Lastly, complain to TMW through official support that they need to find a solution for fixed-width input parsing...altho they seem to want to not admit it, such files do exist and aren't going away irregardless and it's absurd one can't read them easily in Matlab.
