reading tabstops as 4 whitespaces using textscan

67 Views Asked by At

Is it possible to tell MATLAB's textscan to import tabs as four whitespaces? Currently it's replacing a tab with just one whitespace:

raw = textscan(fid,'%s','Delimiter','\n','Whitespace','');

Thank you in advance :)

1

There are 1 best solutions below

0
Johannes On BEST ANSWER

Thank you @Dev-iL,

I thought maybe there is some option to add to textscan, but now I added as you suggested another line of code:

raw = textscan(fid,'%s','Delimiter','\n','Whitespace','');
raw = regexprep(raw{1},'\t','    ');