Preview: Hex/Text Viewer for Undefined File Types

Have a suggestion for "Everything"? Please post it here.
Post Reply
therube
Posts: 4580
Joined: Thu Sep 03, 2009 6:48 pm

Preview: Hex/Text Viewer for Undefined File Types

Post by therube »

Preview: Hex/Text Viewer for Undefined File Types or the option to open any file in Hex/Text mode.

So when I'm looking at .db files that I've located with Everything, sorted by date, & I want to know their "magic number", Preview, in Hex or Text mode, would fit the bill swimmingly, allowing me to simply arrow-key down through the list, visually inspect the "magic number" (& without the need to otherwise view the file in some other means).


(Actually, Hex/Text could be the default... for all file types, & make the user specifically set ... eh, maybe not?)


Universal Viewer can advance through files, sequentially, in a particular directory, but you can't take a "random" list of files discovered by Everything & drop them into UV for perusal.


(So as I'm thinking about this, I hit upon this page, 12 Most Must-Have Free Utilities for Wrangling Text Files. #1 & #2 are two of my most used utilities :-).)


Vim or less would likely work (as a drag & drop target, or Vim from context-menu) ...
void
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preview: Hex/Text Viewer for Undefined File Types

Post by void »

I wonder if there is already a good preview handler for showing hex/text. Anyone know of one?
So when I'm looking at .db files
I can see one problem that might happen is clicking on a 10gb+ file and the preview handler will try to load the entire file to be shown.
The preview handler would have to be smart and only show what is currently visible.

While I would find this useful too, this might scare other users when they click an unknown file and it shows "garbage".

I want to try and avoid reinventing another hex/text viewer in Everything, so if someone knows a good existing preview handler, I could implement an ini option to define a default preview handler.
This default preview handler could be used when there is no associated preview handler for the current selection.

If you wanted to add a text viewer for any file type now, eg db files, open regedit and create the following key:
HKEY_CLASSES_ROOT\.db\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
Set the (Default) data in this key to {1531d583-8375-4d3f-b5fb-d23bbd169f22}

To preview other extensions as text, replace the .db in HKEY_CLASSES_ROOT\.db\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f} with the other extension and set the (Default) data in this key to {1531d583-8375-4d3f-b5fb-d23bbd169f22}

{1531d583-8375-4d3f-b5fb-d23bbd169f22} is the default text preview handler for Windows.
therube
Posts: 4580
Joined: Thu Sep 03, 2009 6:48 pm

Re: Preview: Hex/Text Viewer for Undefined File Types

Post by therube »

While Preview Handler might be preferred, for the moment, looking at external utility.


One that supports drag & drop, that "queue's" files in the order dropped, that can open big files (3.9 GB, Vista ISO as it was), has shortcut keys (Text, Ctrl+T, Hex, Ctrl+H, Next/Prev File, Ctrl+PgDown Ctrl+PgUp).


So I had this utility archived away, "wnbrowse" (v4.8), from 2002.
So I search, WnBrowse - File Viewer, (v4.9.2, from 2008 - I try not to use anything over a decade old ;-)) & it looks like that will fit the (present) bill.


(It did blow up during a [position] scrollbar drag of the 3.9 GB file, but I'm not going to fault it for that.)


(At this point, all I did was to manually extract the installer contents, & manually run the Wnbrowse.exe executable, reviewing it - briefly.)

Oh, & memory is not an issue. Guess it only loads the current "page". Certainly does not load an entire file into memory. No need really for that - for a viewer.
Post Reply