open log file at end

General questions about using TextPad

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

Post Reply
hphillips

open log file at end

Post by hphillips »

Is there a way to configure textpad to open a file and position the cursor at its end rather than at the beginning of the file. I have a long log file and I always have to scroll to the end to update it which is frequently. Thanks
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Not that I'm aware of.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

if the file name to be opened is followed by (123), cursor will be positioned on line 123.

You could try to open your file at a very large line number (a number larger than the actual line count) and see what happens.




Btw, if file name is followed by (123,456) cursor will be positioned on line 123 at column 456.
hphillips

Post by hphillips »

Hi Mudguard -
your sounds like a good idea, but I am not sure how to implement it. Right now I open the log file with textpad via a desktop and the filename and path are specified via the Target: element however when I follow that by number or a number in parentheses as you suggest it still opens with cursor positioned at the beginning. ie I get the same effect with:
Target: d:\hp_data\log.txt
Target: d:\hp_data\log.txt 500
Target: d:\hp_data\log.txt (500)

or did you mean that the method you suggested would work on a command line?

Thanks
hphillips

Post by hphillips »

okay mudguard I see it now - command line parameters in Reference Information in the Help. Thanks for the tip!
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

Post by kengrubb »

This is venturing beyond the halls of TP, but it would work.

Write an AutoIt script using _FileCountLines to return the number of lines in the log file, then open the log file at that line number from a dynamically built command line.

You could even make it dynamic for any file using $CmdLine--a built in array that reads command line parameters.

AutoIt is free.

www.autoit.com
(2[Bb]|[^2].|.[^Bb])

That is the question.
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

You don't need to use AutoIt for this.

This will do it:
"\Path\To\TextPad.exe" file_to_edit(10000000)
Post Reply