MATLAB: Keep space at beginning of a row (textscan)

MATLABtextscanwhitespace

I have a file I am reading in with textscan, which works perfectly, except when there is a space at the beginning of the line that I'm reading in. I have it delimiting at the end of a line ('\n'), which is fine, it just drops any whitespace at the beginning of the line, which is not okay. Is there any way to tell it to read the file lines in exactly?
Ex: I want it to read in " 100" as " 100", not "100".
Thanks! Sarah

Best Answer

Perhaps disabling all white-space removing helps:
textscan(fid, '%s', 'delimiter', '\n', 'whitespace', '')