<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On 13/06/2012 09:24, Tingsten wrote:
<blockquote cite="mid:1339572255519-4024356.post@n3.nabble.com"
type="cite">
<pre wrap="">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</pre>
</blockquote>
Hi again,<br>
<br>
Sorry I missed your first post.<br>
From what I've read, you're almost done:<br>
<blockquote type="cite">
<pre wrap="">First I check where start the data and analyse the format:
<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>f=mopen(file,’r’);data=mgetl(f,10);mclose(f); =>works fine<span class="moz-txt-tag">/</span></i></pre>
</blockquote>
From here, you should have a look at data.<br>
It should be a nlinesx1 matrix of strings from which you can strip
the header and then evaluate the rest as a matrix definition:<br>
<br>
//sample script that worked on the file you put in your first post<br>
<br>
filename='/tmp/dat.csv';<br>
<br>
f=mopen(filename,'r');<br>
data=mgetl(f,10);<br>
mclose(f);<br>
<br>
// Getting rid of the 5 1st lines that corresponds to the header and
converting to a matrix of double<br>
// I assumed the file started at 'Test number ...': if it starts at
'*Header, change 5 into 6<br>
<br>
scan_dat=evstr(data(5:$,:));<br>
clear data<br>
<br>
T=scan_dat(:,1);<br>
CH1=scan_dat(:,2);<br>
CH2=scan_dat(:,3);<br>
CH3=scan_dat(:,4);<br>
CH4=scan_dat(:,5);<br>
CH5=scan_dat(:,6);<br>
CH6=scan_dat(:,7);<br>
<br>
scf();<br>
plot(T,CH1,'r');<br>
plot(T,CH2,'k');<br>
<br>
Hope it helps,<br>
<br>
Antoine<br>
<br>
<blockquote cite="mid:1339572255519-4024356.post@n3.nabble.com"
type="cite">
<pre wrap="">
--
View this message in context: <a class="moz-txt-link-freetext" href="http://mailinglists.scilab.org/500mo-Ascii-file-tp4024324p4024356.html">http://mailinglists.scilab.org/500mo-Ascii-file-tp4024324p4024356.html</a>
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
<a class="moz-txt-link-abbreviated" href="mailto:users-unsubscribe@lists.scilab.org">users-unsubscribe@lists.scilab.org</a>
To check the archives of this mailing list, see
<a class="moz-txt-link-freetext" href="http://mailinglists.scilab.org/">http://mailinglists.scilab.org/</a>
</pre>
</blockquote>
</body>
</html>