[scilab-Users] Re: 500mo Ascii file

Antoine Monmayrant antoine.monmayrant at laas.fr
Wed Jun 13 11:01:41 CEST 2012


On 13/06/2012 09:24, Tingsten wrote:
> Hello Antoine,
>
> Thx you for your post.
> Indeed, I can give more detail about what I would like to achieve.
>
> As you can see in the first post that did includes the first lines of the
> file, I have a 6 channels recording (in fact 7 cause first column is time).
> First think I want to do is to verify that there is nothing "strange" on
> each channel. So I would like at least be able to load the time and 1
> channel (2 first columns) to do a plot. The "game" is to do it in an
> efficient way :
> without loading twice the data =>  what I do using mgetl + msscanf
> and without using an external software to delete the header
>
> If needed I can upload the first lines of the file?
> Thank you for help and have a great day,
> Rémi
Hi again,

Sorry I missed your first post.
 From what I've read, you're almost done:
> First I check where start the data and analyse the format:
> /f=mopen(file,’r’);data=mgetl(f,10);mclose(f); =>works fine/
 From here, you should have a look at data.
It should be a nlinesx1 matrix of strings from which you can strip the 
header and then evaluate the rest as a matrix definition:

//sample script that worked on the file you put in your first post

filename='/tmp/dat.csv';

f=mopen(filename,'r');
data=mgetl(f,10);
mclose(f);

// Getting rid of the 5 1st lines that corresponds to the header and 
converting to a matrix of double
// I assumed the file started at 'Test number ...': if it starts at 
'*Header, change 5 into 6

scan_dat=evstr(data(5:$,:));
clear data

T=scan_dat(:,1);
CH1=scan_dat(:,2);
CH2=scan_dat(:,3);
CH3=scan_dat(:,4);
CH4=scan_dat(:,5);
CH5=scan_dat(:,6);
CH6=scan_dat(:,7);

scf();
plot(T,CH1,'r');
plot(T,CH2,'k');

Hope it helps,

Antoine

>
> --
> View this message in context: http://mailinglists.scilab.org/500mo-Ascii-file-tp4024324p4024356.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
>
> --
> To unsubscribe from this mailing-list, please send an empty mail to
> users-unsubscribe at lists.scilab.org
> To check the archives of this mailing list, see
> http://mailinglists.scilab.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120613/60712dae/attachment.htm>


More information about the users mailing list