From: Karine on
Hello,
I've got datas which are organised like this :
time = 17610576, 17610582, 17610588, 17610594,
17610600, 17610606, 17610612, 17610618,
17610624, 17610630, 17610636, 17610642,
17610648, 17610654;

I use fgetl to catch each line and use regexp to pick numerical datas.
I would like to split with regexp either "=", "," and the "back to new line".
How can I precise several criterion here : regexp(my_line, 'several_criterion', 'split') ?

Thanks for your help !

Karine
From: Daniel Armyr on
Hi.
I am not a regexp expert, but wouldn't it be possible to do it as a two-step process? First split according to the first criteria, and then split the result according to the second?
//DA
From: us on
"Karine " <karine.renouil(a)valorem-energie.com> wrote in message <hqp0pp$2pe$1(a)fred.mathworks.com>...
> Hello,
> I've got datas which are organised like this :
> time = 17610576, 17610582, 17610588, 17610594,
> 17610600, 17610606, 17610612, 17610618,
> 17610624, 17610630, 17610636, 17610642,
> 17610648, 17610654;
>
> I use fgetl to catch each line and use regexp to pick numerical datas.
> I would like to split with regexp either "=", "," and the "back to new line".
> How can I precise several criterion here : regexp(my_line, 'several_criterion', 'split') ?
>
> Thanks for your help !
>
> Karine

one of the solutions

fnam='foo.txt'; % <- your file name...
d=textread(fnam,'%d','delimiter',';, ','whitespace','time=\n');
disp(d);
%{
17610576
17610582
17610588
17610594
17610600
17610606
17610612
17610618
17610624
17610630
17610636
17610642
17610648
17610654
%}

us