From: pako on
Hi all
I am stucked with this. I want to import a ascci with repeated header like this
header begin
mpla....
header end = MM/dd/yyyy hh:mm:ss value
04/20/2010 11:57:54 0.023
04/20/2010 12:00:54 0.015
04/20/2010 12:03:54 0.016
04/20/2010 12:06:54 0.014
......
header begin
mpla....
header end = MM/dd/yyyy hh:mm:ss value
04/20/2010 11:57:54 0.023
04/20/2010 12:00:54 0.015
04/20/2010 12:03:54 0.016
04/20/2010 12:06:54 0.014
......
The lines between header begin and header end is 29 but.The header appears in the ascii with no pattern and in each header only the begin and end is the same .... I only want to get rid of the headers and play only with the 3 tabed data columns
Any help would be appreciated
Thank in advanced
From: us on
"pako " <kokpa81(a)yahoo.com> wrote in message <i30ued$k53$1(a)fred.mathworks.com>...
> Hi all
> I am stucked with this. I want to import a ascci with repeated header like this
> header begin
> mpla....
> header end = MM/dd/yyyy hh:mm:ss value
> 04/20/2010 11:57:54 0.023
> 04/20/2010 12:00:54 0.015
> 04/20/2010 12:03:54 0.016
> 04/20/2010 12:06:54 0.014
> .....
> header begin
> mpla....
> header end = MM/dd/yyyy hh:mm:ss value
> 04/20/2010 11:57:54 0.023
> 04/20/2010 12:00:54 0.015
> 04/20/2010 12:03:54 0.016
> 04/20/2010 12:06:54 0.014
> .....
> The lines between header begin and header end is 29 but.The header appears in the ascii with no pattern and in each header only the begin and end is the same .... I only want to get rid of the headers and play only with the 3 tabed data columns
> Any help would be appreciated
> Thank in advanced

a hint:
- use TEXTREAD/TEXTSCAN to slurp the whole file into a CELLSTR...
- use ML stock string functions to get rid of the headers...
- use ML stock conversion functions to read the data...

us
From: pako on
"us " <us(a)neurol.unizh.ch> wrote in message <i30vls$6a7$1(a)fred.mathworks.com>...
> "pako " <kokpa81(a)yahoo.com> wrote in message <i30ued$k53$1(a)fred.mathworks.com>...
> > Hi all
> > I am stucked with this. I want to import a ascci with repeated header like this
> > header begin
> > mpla....
> > header end = MM/dd/yyyy hh:mm:ss value
> > 04/20/2010 11:57:54 0.023
> > 04/20/2010 12:00:54 0.015
> > 04/20/2010 12:03:54 0.016
> > 04/20/2010 12:06:54 0.014
> > .....
> > header begin
> > mpla....
> > header end = MM/dd/yyyy hh:mm:ss value
> > 04/20/2010 11:57:54 0.023
> > 04/20/2010 12:00:54 0.015
> > 04/20/2010 12:03:54 0.016
> > 04/20/2010 12:06:54 0.014
> > .....
> > The lines between header begin and header end is 29 but.The header appears in the ascii with no pattern and in each header only the begin and end is the same .... I only want to get rid of the headers and play only with the 3 tabed data columns
> > Any help would be appreciated
> > Thank in advanced
>
> a hint:
> - use TEXTREAD/TEXTSCAN to slurp the whole file into a CELLSTR...
> - use ML stock string functions to get rid of the headers...
> - use ML stock conversion functions to read the data...
>
> us

Sorry but how ML is used ... ? I mean that i a followed some examples but i get only errors... I am confused
So far i made this

clear all;
data=textread('original.txt', '%s','delimiter','\t');
count=[];
r=0;
for j=1:length(data)
k=strcmp(data(j), 'Dust Trak');
if k==1
r=r+1;
line=j;
count(r)=j;

end
end

count_2=[];
l=0;
for m=1:length(data)
n=strcmp(data(m), 'Cal. date');
if n==1
l=l+1;
line=j;
count_2(l)=m;

end
end

for q=1:1:length(count);
index(:,q) = [count(q); count_2(q)+7];
end

From the index variable i know the lines where the header begins and ends corresponding to the cell array data....
How can i delete those lines from the cell array data? I ve tried many things but always with an error.
Any idea?
From: Walter Roberson on
pako wrote:

> I am stucked with this. I want to import a ascci with repeated header
> like this header begin
> mpla....
> header end = MM/dd/yyyy hh:mm:ss value
> 04/20/2010 11:57:54 0.023
> 04/20/2010 12:00:54 0.015
> 04/20/2010 12:03:54 0.016
> 04/20/2010 12:06:54 0.014
> ......
> header begin
> mpla....
> header end = MM/dd/yyyy hh:mm:ss value
> 04/20/2010 11:57:54 0.023
> 04/20/2010 12:00:54 0.015
> 04/20/2010 12:03:54 0.016
> 04/20/2010 12:06:54 0.014
> ......
> The lines between header begin and header end is 29 but.The header
> appears in the ascii with no pattern and in each header only the begin
> and end is the same .... I only want to get rid of the headers and play
> only with the 3 tabed data columns

textscan() with the Comment delimiters set to {'header', 'value'} to
cause it to consider everything from 'header' to 'value' as text to be
ignored.