Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Request - "tail/top" plugin

Place your requests for plugins here

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
Dirkus
Posts: 16
Joined: May 31st, 2006, 3:58 am
Location: Elizabeth City, NC, USA
Contact:

Request - "tail/top" plugin

Post by Dirkus »

Those of you familiar with *nix systems likely know the nifty command "tail". It shows you the last line (or last few lines, depending on the arguments) of a file. "top" is the same, only it does the same thing from the beginning of the file. I'd really like to see a plugin that does something similar!

My idea for the plugin would have two functions; function 0 for taking lines from the top of the file and 1 for taking lines form the bottom. The two arguments would then be the file name and the number of lines in to read from. So, for instance...

$dll(toptail.dll,1,c:\somelogfile.txt,0)
$dll(toptail.dll,1,c:\somelogfile.txt,1)

... would return the last two lines of c:\somelogfile.txt, in reverse order on the two lines of the display.

Now all this talk is nice, but I have no programming skills with which to put this into action. Anyone up for this one?

Thanks in advance!

lazybones
Posts: 16
Joined: September 21st, 2006, 7:56 am

Post by lazybones »

http://lcdsmartie.sourceforge.net/commands.html

$LogFile([file],[line])
Read a line from the end of a file [file], where:
[line] is 0-3. 0 fetches the last line, 3 fetches the fourth line from the bottom.

$File([file],[line])
Read a line from a file [file], where:
[line] is the line number (counting from the beginning).

Dirkus
Posts: 16
Joined: May 31st, 2006, 3:58 am
Location: Elizabeth City, NC, USA
Contact:

Post by Dirkus »

AH, I must have missed that one. Thanks for pointing me in the right direction!

-DV

Post Reply