topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 8:52 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: NANY 2019 Entry - Huge Text/Log file reader  (Read 11758 times)

chesterw

  • Member
  • Joined in 2011
  • **
  • default avatar
  • Posts: 10
    • View Profile
    • Donate to Member
NANY 2019 Entry - Huge Text/Log file reader
« on: July 28, 2018, 10:51 AM »
This program reads text files and log files of almost unlimited size.

It does this by reading the file in 1,000 line chunks.

If Reader.exe is called with a parameter, it tries to load that file.
If no parameter is given, or you just double-click on it from Explorer,
then the program starts without an initial file.

When the program first starts, click on the "Load File" button, navigate to
the folder where your file is located, and select the file to read.  Repeat
the process to read a different file.  Exit by clicking the X at the top right.

The program first counts lines in the file.  If the file is huge, you may
see a "Counting lines in file..." message.  Most often this happens too
quickly to see the message for small to medium sized files.

The first 1,000 lines are displayed, with the line number and then the contents
of the line.  The line count is shown in the Edit Box at the bottom.  Use the
scrollbars to scroll up, down, left, and right in that 1,000 line chunk of the
file.  You can edit the text, but not save the file.  You can use your mouse to
select text, and press <CTRL-C> to copy the text to the Windows Clipboard.

Click on "Next 1000" to see the next 1,000 lines of the file, if there are
that many lines.

Click on "Prev 1000" to see the previous 1,000 lines of the file, if past
line 1,000, or maybe the first 1,000 lines.  If the file is large, you may
see a "Moving to previous page..." message.

Click on "Top" to see the first 1,000 lines of the file.

Click on "Bottom" to see the last 1,000 lines of the file.  If the file is
large, you may see a "Moving to bottom of file..." message.

Click on "Search" to try to find lines that exactly match the text in the
Edit Box at the bottom.  You are taken to the first line that matches.  A
fresh chunk is loaded with the matching line on the top of the screen.  If
NOT found, a message is displayed, and you see the first 1,000 lines of the
file.  For a large file, you may see a "Searching..." message.

Whenever a line contains the exact text in the Edit Box at the bottom, that
line shows up in blue.  Even without doing a search: "Next 1000", "Prev 1000",
"Top", and "Bottom" will all show blue lines for exact matches.

Click on "Goto Line" to go to the line number in the Edit Box at the bottom
if the content in the Edit Box at the bottom is a valid integer and the
integer given is less than or equal to the line count.  That line number
becomes the top of the screen.  If the file is very large, you may see a
"Moving to the line..." message displayed while the correct chunk is located.

This program very powerful.  It should be able to handle files up to
18,446,744,073,709,551,615 lines: that's 18 sextillion lines!  Not sure how
to make a text file that big for testing purposes.  Of course, working with
such a file would be slow.  The initial line count would take many minutes,
as well as pressing the "Bottom" and "Prev 1000" buttons.  Sticking with the
"Top" and "Next 1000" buttons on very large files should be the fastest.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,190
    • View Profile
    • Donate to Member
Re: NANY 2019 Entry - Huge Text/Log file reader
« Reply #1 on: July 28, 2018, 12:17 PM »
You might want to zip it and upload it instead of uploading a .EXE.

That said:

https://www.virustot...de59894800/detection

Clean.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: NANY 2019 Entry - Huge Text/Log file reader
« Reply #2 on: January 05, 2019, 09:10 PM »
Could we have a screenshot added to the post?

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,190
    • View Profile
    • Donate to Member
Re: NANY 2019 Entry - Huge Text/Log file reader
« Reply #3 on: January 06, 2019, 12:35 PM »
Could we have a screenshot added to the post?

He hasn't visited since July of last year, so unless someone does it, not sure he will.

chesterw

  • Member
  • Joined in 2011
  • **
  • default avatar
  • Posts: 10
    • View Profile
    • Donate to Member
Re: NANY 2019 Entry - Huge Text/Log file reader
« Reply #4 on: January 07, 2019, 06:40 AM »
Here is a screenshot, and a slightly enhanced version.

Still cannot figure out how to test the maximum 18 sextillion lines limit...

chesterw

  • Member
  • Joined in 2011
  • **
  • default avatar
  • Posts: 10
    • View Profile
    • Donate to Member
Re: NANY 2019 Entry - Huge Text/Log file reader
« Reply #5 on: March 07, 2019, 09:26 AM »
Corrections, and added (Search) Again feature.
-----------------------------------
This program reads text files and log files of almost unlimited size.

It does this by reading the file in 1,000 line chunks.

If Reader.exe is called with a parameter, it tries to load that file.
If no parameter is given, or you just double-click on it from Explorer,
then the program starts without an initial file.

When the program first starts, click on the "Load File" button, navigate to
the folder where your file is located, and select the file to read.  Repeat
the process to read a different file.  Exit by clicking the X at the top right.

The program first counts lines in the file.  If the file is huge, you may
see a "Counting lines in file..." message.  Most often this happens too
quickly to see the message for small to medium sized files.

The first 1,000 lines are displayed, with the line number and then the contents
of the line.  The line count is shown in the Edit Box at the bottom.  Use the
scrollbars to scroll up, down, left, and right in that 1,000 line chunk of the
file.  You can edit the text, but not save the file.  You can use your mouse to
select text, and press <CTRL-C> to copy the text to the Windows Clipboard.

Click on "Next 1000" to see the next 1,000 lines of the file, if there are
that many lines.

Click on "Prev 1000" to see the previous 1,000 lines of the file, if past
line 1,000, or maybe the first 1,000 lines.  If the file is large, you may
see a "Moving to previous page..." message.

Click on "Top" to see the first 1,000 lines of the file.

Click on "Bottom" to see the last 1,000 lines of the file.  If the file is
large, you may see a "Moving to bottom of file..." message.

Click on "Search" to try to find lines that exactly match the text in the
Edit Box at the bottom.  You are taken to the first line that matches.  A
fresh chunk is loaded with the matching line on the top of the screen.  If
NOT found, a message is displayed, and you see the first 1,000 lines of the
file.  For a large file, you may see a "Searching..." message.

Click on "Again" to search again, starting at the next block (1,000 lines
after the top of the current block).  The top line of the new block (assuming
a match) becomes the top of the new block.  For example, suppose the first match
after line 1,000 of the file is on line 1,500: the block you are viewing becomes
line 1,500 through line 2,499.

Whenever a line contains the exact text in the Edit Box at the bottom, that
line shows up in blue.  Even without doing a search: "Next 1000", "Prev 1000",
"Top", and "Bottom" will all show blue lines for exact matches.

Click on "Goto Line" to go to the line number in the Edit Box at the bottom
if the content in the Edit Box at the bottom is a valid integer and the
integer given is less than or equal to the line count.  That line number
becomes the top of the screen.  If the file is very large, you may see a
"Moving to the line..." message displayed while the correct chunk is located.

This program very powerful.  It should be able to handle files up to
18,446,744,073,709,551,615 lines: that's 18 sextillion lines!  Not sure how
to make a text file that big for testing purposes.  Of course, working with
such a file would be slow.  The initial line count would take many minutes,
as well as pressing the "Bottom" and "Prev 1000" buttons.  Sticking with the
"Top" and "Next 1000" buttons on very large files should be the fastest.

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,642
    • View Profile
    • Donate to Member
Re: NANY 2019 Entry - Huge Text/Log file reader
« Reply #6 on: March 22, 2019, 12:07 AM »

As for the test case, wouldn't a "concatenator" program work?
I'm not familiar with the inbuilt limits of basic desktop OS's but I presume somewhere a test file could be created!

Bonus:
How long is a complete human genome!!?
Be careful we aren't creating Gattaca with all the Nany's combined!
Wouldn't a version of your program be able to list each (code item?) of a genome in a vertical list?
Then you compare two genomes side by side and Compare?
I smell a Science Fiction story coming!

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,642
    • View Profile
    • Donate to Member
Re: NANY 2019 Entry - Huge Text/Log file reader
« Reply #7 on: March 22, 2019, 12:13 AM »
Meanwhile, I've had this old school streak, and I'm always fond of Back To Text, and this year's Nany's have several!
Yours is interesting in part for me because I am about to dabble learning the next level of serious chess again and in chess discussions you get these "oh, what was that Tal game again? The one where he played that Sacrifice such-and-such?"

So then you have your master lists of the game files, and FYI "Portable Game Notation" is very little more (on purpose) than text with certain headers. Way back for one of these Nany's I submitted a file reader, but it aged out I think somewhere near Win 7-8-10.
(Note to self: If I chatter enough, I recall things! My ancient Laptop is still XP!)

So anyway, Because this line numbers the file,  let's say you make little game snippets, I just grabbed any two of his wins, you know right where to go jump to later to go get the game again (which could later be imported into some other more fancy program).

see elsewhere for my remarks on Ham Radio's "component". So I could save portions of chess concepts I want to work on in Ham's program, and then copy the string into yours to find a matching game! Sure all the big boy dayabases can do that, but Old School!

:Thmbsup: