The option to peek into a file rather than load it

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Ryck
Posts: 50
Joined: Thu Mar 17, 2005 4:20 am

The option to peek into a file rather than load it

Post by Ryck »

There are times when all I need to do is inspect the beginning three to five lines of a file rather than load the whole thing -- just to see if the file has a file header and give me an idea what data values I'm getting prior to loading into my databases.

In those cases I need TextPad simply as a file inspecter rather than an editor. I don't need the whole file loaded. Especially when the file is HUGE! We're talking about 500 megabytes and higher.

If the TextPad programmer can add the option to load just the first few lines and stop loading - it would be a big time saver and a big convenience.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

get yourself a tail utility.

Usually
tail -+5 filename
displays the first 5 lines of a file, while
tail -5 filename
displays the last 5 lines ...
bveldkamp

Post by bveldkamp »

No need to search+download a separate utility:
"MORE filename", then Ctrl+C after the first page.
munsey
Posts: 1
Joined: Fri Aug 17, 2007 4:57 pm

Post by munsey »

Could TextPad be enhanced to be able to do this? I am interested in using TextPad as a log viewer/monitor. Perhaps another option in the "When files are modified by another process" group, have a tail -f option.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Create a TextPad Tool using bveldkamp's solution with MORE.
Hope this was helpful.............good luck,
Bob
Zhiroc
Posts: 7
Joined: Sat Aug 11, 2007 5:40 pm

Post by Zhiroc »

If you have perl installed (and who doesn't? :) ), here's a cheap "head" function:

Code: Select all

perl -pe "exit if $. > 5" file.txt
(This works in a Command Window, you might have to play with the quoting, etc. to make it a tool.

The only problem is that textpad doesn't have a generic file selector dialog to feed a filename easily to a tool. The best you could do is to type in the filename using the "prompt for parameters" option, unless I'm missing something.
Post Reply