From: Jan Simon on
Dear RZee,

> '---------- GREEDY_CBR_SEED1.STAT'
> '2'
> '3'
> '4'
> '5'
> '6'
> '7'
>
> I need to delete '--------GREEDY........' line from the cell. How can I do that?
> I've tried 'strrep' and it does not meet what I'v expected.

You forgot to mention, what you exactly expect.

This e.g. deletes all cell elements starting with '--':
C(strncmp(C, '--', 2)) = [];

Good luck, Jan
From: RZee Dziyauddin on
"Matt Fig" <spamanon(a)yahoo.com> wrote in message <huto8j$7qt$1(a)fred.mathworks.com>...
> Assuming your string always starts with '-'
>
> c(cellfun('isempty',regexprep(c,'^-.*',''))) = []

Hi;

Thank you. I've tried that command and it does delete all the string lines. Many thanks for your help.

Cheers.

RuZee
From: RZee Dziyauddin on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <hutr6a$k6b$1(a)fred.mathworks.com>...
> Dear RZee,
>
> > '---------- GREEDY_CBR_SEED1.STAT'
> > '2'
> > '3'
> > '4'
> > '5'
> > '6'
> > '7'
> >
> > I need to delete '--------GREEDY........' line from the cell. How can I do that?
> > I've tried 'strrep' and it does not meet what I'v expected.
>
> You forgot to mention, what you exactly expect.
>
> This e.g. deletes all cell elements starting with '--':
> C(strncmp(C, '--', 2)) = [];
>
> Good luck, Jan

Hi Jan;

I've tried your suggested command and it does delete all the unnecessary lines. Many many thanks.

Cheers,

RuZee
From: us on
"RZee Dziyauddin" <ujie78(a)yahoo.com> wrote in message <huisb8$s76$1(a)fred.mathworks.com>...
> Hi;
>
> Does anyone has a clue how to delete the string line from the cell array?
>
> E.g.
> '---------- GREEDY_CBR_SEED1.STAT'
> '2'
> '3'
> '4'
> '5'
> '6'
> '7'
>
> I need to delete '--------GREEDY........' line from the cell. How can I do that?
> I've tried 'strrep' and it does not meet what I'v expected.
>
> Many thanks.
>
> RZee

a hint:

help regexprep;

us