Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 1 Jahr, 5 Monaten
Letzter Beitrag:
vor 1 Jahr, 5 Monaten
Beteiligte Autoren:
kingdr, Tor-Bjarne, Danny Lauwers

wx: similar to tail function in linux

Startbeitrag von kingdr am 03.05.2016 16: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

Antworten:

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

von kingdr - am 03.05.2016 17:11
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

von Danny Lauwers - am 03.05.2016 19:01
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 and linux .

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

Cheers

King

von kingdr - am 03.05.2016 20:18
Hi,

Cant you use fOpen and fSeek to achive this behaviour?

Cheers
Tor-Bjarne

von Tor-Bjarne - am 04.05.2016 07:09
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

von kingdr - am 04.05.2016 11:19
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

von kingdr - am 04.05.2016 11:29
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.