|
On 20 Des, 11:52, nukeymusic <nukeymu...@gmail.com> wrote:
> Is it possible to make the following code run faster?
>
> clear
> %example format of testfile which has thousands of these lines
> %Dec-01-13:18:59 24.8 +1.54415760E-01 7.387060E-06 2.579755E+00
> %Dec-01-13:19:26 24.8 +1.54396330E-01 7.389665E-06 2.580398E+00
> %Dec-01-13:19:53 24.8 +1.54362790E-01 7.391425E-06 2.580347E+00
> fmt = "%s %f %f %f %f";
> [A, B, C, D, E] = textread("testfile", fmt);
> y=[(datenum(cell2mat(A),'mmm-dd-HH:MM:SS')-datenum(cell2mat(A(1)),'mmm-
> dd-HH:MM:SS'))*24*60*60 B C D E];
> save('outputfile','y');
>
> thanks in advance
> nukey
Processing text files take time. Expect 5-10
minutes per GByte.
Apart from that, with the skill level indicated
by your question about writing files a couple of
days ago, you might be better off leaving your
computer to process your files overnight. Learning
the skills necessary to do this will take you
some time. That effort would only be justified
if you want to learn programming, or if you need
to do this kind of processing under time pressure
on a daily basis.
Rune
|