…meie igapäevast IT’d anna meile igapäev…

2011-09-12

StreamTextViewer

Filed under: Isiklikud,Programmeerimine — Sander @ 17:38:57

Download StreamTextViewer.exe (35KB)

Imre’s recent blog post about reading large text files reminded me about a proof-of-concept prototype I did a while ago – i.e. opening and viewing large text files in .NET. It is useful when looking at huge log files or XML data dumps – et.wikipedia data dump is open in the screenshot. Most “regular” programs choke at such files – for example, it is more or less impossible to open 100+ MB file in otherwise very fast Notepad++, similarly super-fast firstobject XML editor chokes even on a medium-size database dump.

StreamTextViewer is based on StreamViewer() class, reading the file in chunks. You’ll need .NET 3.5 use the app.

Remember, this is really just a proof-of-concept prototype and not finished & polished application. Especially navigation is not all that great, also it is missing a multitude of niceties usually found in normal apps.

Features:

  • Opens any size of text file (well, you might get an error if your file is bigger than 9,223,372,036,854,775,807 bytes, that is 9.223 exabytes, or about 100 times the data that exists right now in tha internets. The current NTFS implementation only supports files up to 16 TB, so you are SOL anyway if you have a bigger file :P).
  • Fast, with a low memory footprint (about 30..40 MB when the file is loaded).
  • Auto-detects encoding (displayed in the status strip).
  • Supports any encoding that .NET supports.
  • Fairly fast search (note: case sensitive!).
  • Go-to feature: go to specific percent or location of the file.
  • Supports *nix-style \n line endings.
  • “Navigation bar” on the right, showing current position. You can also move the rectangle or click on the bar to go to a new location.

Possible to-do list for the future:

  • Come up with a better name!
  • Better navigation – load next chunk automagically when user reaches end of the current one
  • Search: case insensitive search, regexp
  • Encoding: allow user to change encoding-on-the-fly
  • Opening file from the command line, drag and drop
  • Editing? Search & replace
Advertisements

Lisa kommentaar »

Kommentaare veel pole.

RSS feed for comments on this post. TrackBack URI

Lisa kommentaar

Täida nõutavad väljad või kliki ikoonile, et sisse logida:

WordPress.com Logo

Sa kommenteerid kasutades oma WordPress.com kontot. Logi välja /  Muuda )

Google+ photo

Sa kommenteerid kasutades oma Google+ kontot. Logi välja /  Muuda )

Twitter picture

Sa kommenteerid kasutades oma Twitter kontot. Logi välja /  Muuda )

Facebook photo

Sa kommenteerid kasutades oma Facebook kontot. Logi välja /  Muuda )

w

Connecting to %s

Blog at WordPress.com.