[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to do equivalent of Linux 'tail' script into Octave variables?
From: |
Markus Mützel |
Subject: |
Re: How to do equivalent of Linux 'tail' script into Octave variables? |
Date: |
Sun, 22 Sep 2019 12:22:42 +0200 |
On 2019-09-22 06:41 Mark Smith wrote:
> I have a script reading instrument output quite nicely using importdata()
>
> The instrument runs for hours, and creates a comma delimited ASCII data file,
> which has new data appended every second. Can't find a way to get incremental
> data that is added each second.
>
> Must I drop down to C style I/O to read the file, then re-read it and parse
> for updates? How can I get the equivalent running a fork of the data
> acquisition process and looking at the stream of data provided by a 'tail'
> piped into a process?
>
> Thanks, Mark
If you open the file with fopen, read to its end and call "fclear" on the file
identifier, you should be able to read from the file again starting at the
previous position.
Afaics, "importdata" opens and closes the file each time it is called. So I
don't think the same is possible using that function.
Maybe you could achieve something similar using "textscan" on the string that
you read (consecutively) from the file...
HTH
Markus