import txt file containing some comment character = "#"

Hi all, I want to import an txtfile containing in the middle of the file some lines with a comment character "#". Thank you in advance,

 Accepted Answer

Mention:
....'CommentStyle','#')
fileID = fopen(filename); %an example
C = textscan(fileID,formatspec','Delimiter',',','CommentStyle','#');
fclose(fileID);

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!