Page 1 of 1
open log file at end
Posted: Wed Jan 18, 2012 8:28 pm
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
Posted: Wed Jan 18, 2012 9:11 pm
by ak47wong
Not that I'm aware of.
Posted: Wed Jan 18, 2012 9:33 pm
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.
Posted: Thu Jan 19, 2012 2:49 am
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
Posted: Thu Jan 19, 2012 2:57 am
by hphillips
okay mudguard I see it now - command line parameters in Reference Information in the Help. Thanks for the tip!
Posted: Wed Feb 01, 2012 4:15 am
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
Posted: Wed Feb 01, 2012 8:25 am
by ben_josephs
You don't need to use AutoIt for this.
This will do it:
"\Path\To\TextPad.exe" file_to_edit(10000000)