Should I suggest my approach: read a file that is constantly being written?

I have one csv file that the script is continuously writing. It writes a timestamp and some other data in a row. First I have to read the latest data. I am currently using RandomAccessFile in java to read the file in reverse order. But since it is constantly written, I have to read the new data with priority. I support which timestamp is sent and does the job. This results in unnecessary scan actions.

Is there a better way to handle this scenario?

Thanks in advance,

+5
source share
5 answers

, , .

, , , . , , , , - , . , , , .

+1

:

  • CSV. , , .

  • , , . . , . , , . ?

+1

script, CSV . , , ; , ..

0

.

, - , CSV, , .

, , , :

, , -, . , () , .

, , Java.

0

Unix,

tail -f /csv-file | custom-program

- Java.

I assume that your Java program is a kind of server application that cannot be run from the command line. If that were ok, then you could replace the special program with your Java program.

0
source

All Articles