Deleting line containing symbol.
Show older comments
Hi can You help me finish this command:
E(any(regexp(E, 'A|' , 'match' );,2),:) = [];
Deleting line in variable E(readed by textscan), containing A|.
Thank You.
Accepted Answer
More Answers (1)
Azzi Abdelmalek
on 4 Feb 2013
E='assA|stA|'
idx=regexp(E,'A|')
E(idx+1)=[]
4 Comments
ZK
on 4 Feb 2013
Azzi Abdelmalek
on 4 Feb 2013
E={'assA|stA|'}
E=E{1}
idx=regexp(E,'A|')
E(idx+1)=[]
Can you post a sample of your data?
Azzi Abdelmalek
on 4 Feb 2013
%or
E={'assA|stA|';'azekaA|assaA|'}
for k=1:numel(E)
a=E{k}
idx=regexp(a,'A|')
a(idx+1)=[]
E{k}=a
end
ZK
on 4 Feb 2013
Edited: Azzi Abdelmalek
on 4 Feb 2013
Categories
Find more on Characters and Strings 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!