MATLAB: How do i use textscan to display strings have spaces in between

textscan

Hi friends, i have used this code with textscan:
fidpw= fopen('yy.txt','rt');
format = repmat('%s ',[1 row1]);
Pat = textscan(fidpw,format );
fclose(fidpw);
i used texscan to display the columns in this file but it doesn't work well because of the space existed in between the first rows of its corresponding columns
the columns looks like :
col1={stage iiib;t3;n1;m0}
col2={stage iv;t4;n1;m1}
code output looks like:
col1={stage;stage;t3;n1;m0}
col2={iiib;iv;t4;n1;m1}
?????
is this because i used %s in textscan ???
Thanks in advance!

Best Answer

In that situation, you should
Pat = textscan(fidpw, format, 'whitespace', '', 'delimiter', ';');