Delete lines that include ## text ##
7 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Walter Roberson
on 8 Feb 2012
textCell = textscan(fileID, '%s', 'Delimiter', '\n', 'CommentStyle', {'###', '###'});
0 Comments
See Also
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!