PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → wx: similar to tail function in linux
wx: similar to tail function in linux
Débuté par kingdr, 03 mai 2016 18:51 - 7 réponses
Posté le 03 mai 2016 - 18:51
Hi All

I have a big text file 10G bytes and I just wanna see last 100 lines of text from bottom and
it's slow to use fLoadText and the loop or fReadLine in wx but I couldn't find out
any which is similar to "tail -100 myBigFile.txt " in linux.

Any help or work around is highly appreciated.

Thx in advance.

King
Posté le 03 mai 2016 - 19:11
I downloaded WRK (Windows Resource Kit) that has tail function and it works fast
by reading just last 10 lines from 10G of text file by using exeRun and floadtext the
output10Line file. OK, just work-around is good and best if anyone finds out
a function in wx is great.

Cheers

King
Posté le 03 mai 2016 - 21:01
Hi,

Have you tried the fSeek function to first position the readpointer at the end - xxx of the file ?

See: http://doc.pcsoft.fr/en-US/?3036039&name=fSeek

Danny
Posté le 03 mai 2016 - 22:18
Thx Danny, at least fSeek will work but lots of work as log files keep appending
every end of line ie I need to write a wrapper working like tail and the tail function
works for both windows <CR><LF> and linux <LF>.

Hmm... a wish list for wd22, hopefully.

Cheers

King
Posté le 03 mai 2016 - 22:25
If you are looking for a Windows utility that provides functionality similar to the UNIX/LINUX tail command, try baretail. It looks like the web site is down (https://www.baremetalsoft.com/baretail/) but it can be downloaded from CNET and other sites as well.
Posté le 04 mai 2016 - 09:09
Hi,

Cant you use fOpen and fSeek to achive this behaviour?

Cheers
Tor-Bjarne
Posté le 04 mai 2016 - 13:19
Tor-Bjarne

It's much easy to use tail as I have lots of log files like wb..log, email logs, they
are large each and it's quiky to use timer to get those lines for my maintenance,
each log file size is more than 100M and some has 12G bytes and tail gives
very fast of requested lines of data of my need.

Cheers

King
Posté le 04 mai 2016 - 13:29
Pls see link as below of exactly of what I want:

"http://stackoverflow.com/questions/12523044/how-can-i-tail-a-log-file-in-python"

I need to use such everyday to develop my push notification with fast response purpose.

King