Delete lines that include ## text ##

7 views (last 30 days)
Urban Kova
i
Urban Kova i on 8 Feb 2012
Hi,
I need to import a text into matlab using:
fileID = fopen('proba2.txt','r','n', 'windows-1250');
[text, count] = fread(fileID);
text=text'
After I import it (or as I import it, it doesn't matter) I would like to delete the lines in the text containing (there is nothing else writen in that line):
## (some random text) ##
I don't even have idea where to start so any suggestions would be more than welcome.
Thanks a lot.

Answers (1)

Walter Roberson
Walter Roberson on 8 Feb 2012
textCell = textscan(fileID, '%s', 'Delimiter', '\n', 'CommentStyle', {'###', '###'});

Categories

Find more on Data Import and Export in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!