How to open the tail of 8 GB log files using Notepad++ in Windows?

14

6

How to open the tail of 8 GB log files using Notepad++ In Windows?

I used Notepad Document Monitor but don't quite get how to use it. I start monitoring and then what? How do I select the large file?

I can't just open the file because it's 8GB. So I got this large file 8GB log. I only want to see the tail. Like the last 100k lines, for example.

https://confluence.atlassian.com/pages/viewpage.action?pageId=321854547

says I should open the file.

The whole point of seeing only the tail is because the file is too large. I only want to see the tail.

user4951

Posted 2014-05-07T11:35:34.583

Reputation: 3 015

1Your question is not clear. Please [edit] your question to explain what you are trying to do; include details and any error messages you are receiving. – CharlieRB – 2014-05-07T11:39:53.540

I think you are confused how this works. This plug-in doesn't read the closed file and return the tail of it. Nor does it open only part of the file. It has to open the entire file to monitor it. – CharlieRB – 2014-05-07T11:50:00.377

1

Check this Stack Overflow question out...Looking for a windows equivalent of the unix tail command.

– CharlieRB – 2014-05-07T11:56:55.497

Answers

17

You can use the PowerShell 3 command: Get-Content yourfile.log -Tail 100

niutech

Posted 2014-05-07T11:35:34.583

Reputation: 763

2Worked great! -TotalCount is how to get the head. – ShawnFeatherly – 2019-04-09T05:50:51.350

5

I'll confess to having used 7Zip to occasionally work around huge files. Here's how:

  1. Install 7-Zip. You probably want this anyway.
  2. Right click the giant log file.
  3. Select 7-Zip -> Add to archive...
  4. Change "Archive format" to tar
  5. Change "Split to volumes, bytes" to 650M or whatever size you want the chunks
  6. Click OK - It should generate a bunch of files with the same name but ending in .tar.001 and .tar.002
  7. Open those files in Notepad++ or whatever you use to read files.

There are some downsides:

  • The first line of the first file will have some tar related garbage.
  • The files typically don't start/stop on newline boundaries.
  • Won't work if the file is being actively appended to.

Ryan

Posted 2014-05-07T11:35:34.583

Reputation: 151

You can basically choose any compression algorithm that lets you choose a compression level of 0 or rate of 0%. – Martin Hennings – 2017-02-13T12:15:40.127

instead of using 7z, there are lots of tools to handle huge files efficiently. And there are the built-in tail-like commands so you don't need to go through so many steps – phuclv – 2019-12-05T15:18:23.190

@phuclv You're right and I agree but can you be more constructive? Which tools do you recommend? Which built-in tail-like commands? – Ryan – 2019-12-09T18:17:58.183

1

Use a hex editor such as HxD, they usually stream the hard drive instead of reading the entire file.

Select everything from top to bottom, then start deselecting upwards whatever you want to keep.

Delete everything you don't want (this may take a bit of time and a loading bar may appear, but shouldn't hang or get overloaded like Notepad++ would).

Then, you can open it in Notepad++, in case you don't require a more automatic solution.

Deji

Posted 2014-05-07T11:35:34.583

Reputation: 131

1

You can use Total Commander's file lister function (hotkey is F3) or standalone version which is available here: Lister standalon

The integrated file lister allows to view files of almost any size (up to 2^63 bytes) in text, Unicode, HTML, binary or hex format, bitmap graphics (bmp, jpg, gif, png), multimedia files, and now also RTF files. It keeps only a small part of the file in memory (except for bitmaps), the rest is automatically loaded when scrolling through the text.

Jessica

Posted 2014-05-07T11:35:34.583

Reputation: 21

1

You can use an dedicated data workbench, it's called Ankhor FlowSheet.

  • Install the package 'Display and Filter Large Texts'
  • Import the containing library LargeTextReader.flsx
  • Specify the path to your file
  • You GTextOpen to open it
  • Connect it with GTextView
  • Connect it with the Dashboard
  • Have fun scrolling trough the file !

There are many operators to filter, join or extract the required lines.

The best thing is, that you don't need 8gb of RAM to get the file into the view, the data will be 'streamed' through small chunks with almost no delay.

I myself was already able to look into an OSM data file with 43gb and more than 600 million lines...

The Community Edition of the application is free and should be suitable even for such tasks.

Screenshots of the FlowSheet:

Graph:

enter image description here

Dashboard:

enter image description here

Datenwürfel

Posted 2014-05-07T11:35:34.583

Reputation: 11

0

I was using BareTail for a long time, but it was missing features like filtering, time sync, line numbers, side by side view and so on ... so finally I wrote my own log-viewer: "Loxx". It is for Windows only and free of charge with a limited functionality, can read huge files, real time updates and much more.

A license is required for:

  • Saving changed files
  • Filtering of files
  • Any use of regular expressions or wildcards
  • Time synchronization between files

Here's a screenshot of the main window:

Please have a try — any feedback is welcome!

mommos

Posted 2014-05-07T11:35:34.583

Reputation: 1

Ultra Edit can do this. Files can be any size so put on an SSD disk. You can then go to the end, select what you want and put it in a new file – John – 2019-12-04T19:40:21.133

.... but I want to see a log in real time .. define stop triggers .. hide useless lines ... etc .. ... and I had a try with UltraEdit and a 70 GB test file ... still waiting for a response :-) – mommos – 2019-12-04T20:03:21.220

The link is, of course, useful, but it would be better if you explained more of the features — and, specifically, what's free and what isn't.  Please do not respond in comments; [edit] your answer to make it clearer and more complete. – G-Man Says 'Reinstate Monica' – 2019-12-04T20:59:15.707

0

This don't really answer your question but if you are going to look into huge files I have found the gun to be the only working editor http://www.movsd.com/thegun.htm homepage looks like crap and editor was written ages ago in assembler and have few features, but it works.

I also think baretail can handle those huge files but is not 100% sure, baretail is also a tailer and have some features like filters and such. (if you just want the end of the file I assume you are going to analyze logs, can't se any other sane situation) https://www.baremetalsoft.com/baretail/

Griffin

Posted 2014-05-07T11:35:34.583

Reputation: 324

-1

I would send the tail to a new file and open new file in notepad++.

tail -200 "myfile.txt" > tempfile.txt

user18896654353

Posted 2014-05-07T11:35:34.583

Reputation: 99

1They stated they are running Windows. Tail is a Linux command, is it not? – CharlieRB – 2014-05-07T11:53:54.000

2

Well, it is, originally. But you can use GNU Utils for Wi32. Then you will have tail command in your windows environment. See this thread

– Art Gertner – 2014-05-07T11:56:44.020

2For your answer to be complete & useful, you should edit it to include those details. – CharlieRB – 2014-05-07T11:57:48.713

@CharlieRB, it is not my answer. I will leave it for user1889665 to make those edits – Art Gertner – 2014-05-07T12:03:49.163