TOT: How to examine end of 10GB log file on a Windows PC?

Jul 12, 2013 13 Replies
Saved reading

First reply

John Rumm

You did not say which version of windows, however if its 7 or later, then open the power shell, and do: Get-Content logfilename.txt -Tail 50 to display the last 50 lines. To maintain a live watch on the end of a file use the -Wait switch (Ctrl + C will exit) If using XP then…

Read the full reply

As per title ...



I have an improvement I wish to make to a program, not one that I've written, but I did write most of the 680x0 emulator that now runs it on current hardware. I hope to discover a suitable execution address in the Program Counter to have the emulator kick in to update the display before continuing execution of the program. I already have a similar such 'fix' working very well, except that it doesn't get called as the program ends, so part of the final display is annoyingly out of date.



The only way I can work out what needs to be done is to see in detail what happens when the prog comes to an end. Thus, I have had the emulator list the entire running of the prog from start to finish, resulting in a log file of a mere 10GB! Naturally, I had expected it to be big, but not as vast as it has turned out in reality.



Any suggestions as to how I can split this up into chunks, so that I can load the tail end of it into an editor to see what is going on?


You did not say which version of windows, however if its 7 or later, then open the power shell, and do:

Get-Content logfilename.txt -Tail 50

to display the last 50 lines.

To maintain a live watch on the end of a file use the -Wait switch (Ctrl

  • C will exit)

If using XP then there are plenty of tail type commands you can install like:

formatting link

If you are more a *nix kind of guy, then consider installing cygwin, which will add all the normal *nix style commands and command line tools.

Install cygwin and use the 'tail' command?

Or dual boot into Linux and use the same.

Or use something like Perl to open it in 'append' mode then read backwards?

Or set up your terminal window with a suitable buffer size, list the file using 'type', go down the pub for a couple of pints, come back, and cut and paste the end of the listing :-)

Plenty more where all this came from.

In essence you need code which can open a file then position the file read pointer at the end of the file, wind back a bit then output.

Cheers

Dave R

My problem has always been doing this without installing anything - and on everything from W2K (including servers) right up to date. When connecting to other people's computers it is often not appreciated when you install things!

Java Jive :

Baretail works for me:

formatting link
(Windows)

then put your programs on a CD-ROM or USB stick. No need to install them

OK - and when remotely accessing the 150 servers?

You've got the CD-ROM image, so can mount that via ILO or iDRAC. Or the files which you can transfer via RDP if on a windows box. This is trivial server administration.

Modern stuff should have the power shell installed by default. You can get "portable" versions of some of the other stuff that will run without installation.

Stick your utility on a web site where you can get it, or create a VPN back to your machine from the machine you are working on, or use the upload capability of most remote control applications.

Thanks for this, though I'm not sure why I didn't think of it for myself - bit short on sleep I suppose, as these days I seem semi-permanently to be.

Booted from a Linux Live CD and used 'tail' to capture the last

100,000 l>

On my W7, Get-Content didn't have a -tail option.

I couldn't get this to work properly.

Make sure you have windows management framework 3 or higher:

formatting link

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required