Hi Ilvana,
The solution by Jim might work, but depends on your data.
What I do is converting from dos standard to mac standard using the bash script dos2mac (will add .mac to the .txt logfile) via a system call in Matlab "system(['dos2mac ' input_txt]);".
Next I read the whole file using textscan:
fid = fopen([input_txt(:,1:end-1), '.mac']);
log_file=textscan(fid,'%s');
log_file=log_file{1,1};
Then I walk the log_file extracting the stuff I need:
k=1;
for i=1:length(log_file);
if strcmp(log_file(i),'StimArray.OnsetTime:')==1;
log_extracted(k+1,1)=log_file(i+1);
k=k+1;
else
end
end
HTH.
Cheers,
Stijn Michielse
Maastricht University
|