Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tail -n 1000 in Java (Apache commons, etc)

Tags:

java

tail

I'm wondering if util code already exists to implement some/all of *NIX tail. I'd like to copy the last n lines of some file/reader to another file/reader, etc.

like image 816
Jacob Avatar asked Nov 06 '22 21:11

Jacob


1 Answers

This seems like a good bet: Tailer Library. This implementation is based on it, but isn't the same. Neither implement a lookback to get the last 100 lines though. :(

like image 158
cgp Avatar answered Nov 14 '22 23:11

cgp