AutoHotkey Community

It is currently May 27th, 2012, 10:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: January 28th, 2005, 4:58 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
To keep track of the line-count between sessions, you can either use an Ini file (with IniWrite and Read) or just a plain text file such as this:

FileDelete, LinesToSkip.txt
FileAppend, %LinesToSkip%`n, LinesToSkip.txt

Then next time your script start up, it can read the count back in:
FileReadLine, LinesToSkip, LinesToSkip.txt, 1


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2005, 12:38 am 
How do you capture the output from tail.exe into a variable usable by autohotkey? This seems to be my current roadblock on the way to creating a real time parser/reader.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2005, 1:27 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Try this topic: CMDret - Capture Output from Console

In addition, the FAQ contains a method to send command line output directly to the clipboard.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 8th, 2005, 2:57 am 
I hate needing to be lead by hand for this.. but I spent another hour or two trying to decipher the syntax needed for both of these to work correctly. Currently, I have no working solution. Unfortunately, this leads me to ask for another bit of help.. assume all the files are in the same folder. I want tail.exe to read the last line of a .txt file called paplogdemo.txt. From here, I want that last line to be placed in a variable workable by AHK. So, for example, if I do a
Code:
MsgBox %variable%

I will get told what the last line of the file is at that time. (I have a pretty solid idea in my head using loops to just redo that line of code over and over again, comparing to a separately stored copy of the last iteration for comparison to avoid trigger spamming if nothing changes). I've attempted the straight up code for AHK, using the suggested checking method of last update to the file, etc, but it doesn't appear to work correctly. It will only read the file to the end once no matter what I do.

Anyways, if you could shoot out the line needed to grab the output from tail.exe (with the definined parameters for the last line), I'd highly appreciate it. Thanks again.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2005, 4:42 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Nalerian wrote:
if you could shoot out the line needed to grab the output from tail.exe (with the definined parameters for the last line), I'd highly appreciate it.
Using the cb.exe utility to send it to the clipboard, this method seems to work:
Code:
Run, %comspec% /c "tail.exe -n1 "C:\My File.txt" |cb.exe"
LastLine = %clipboard%
MsgBox %LastLine%
There are nested quotes in the above, which seem to work on Win2k/XP but I'm not sure about Win9x.

I'm still planning to looking into corrupt's CMDret - Capture Output from Console someday, and possibly integrate it into AutoHotkey if it isn't too difficult.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2005, 9:05 am 
Might be usefull to check that post ---> [here] 8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2005, 9:25 am 
Just wanted to say that I got it working beautifully and thank you. That was a tremendous help in getting the program to work.

Thanks again


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2005, 6:04 pm 
Offline

Joined: March 20th, 2005, 5:33 pm
Posts: 17
Dixon wrote:
Hrm i will look into this. The log files are only a couple of meg at the most usually. Would something that size be trouble? The tail.exe though sounds interesting ;)

thank you.


I have 2 gig log, and for some magical reason "tail" on my debian system doesn't even blink to display the last 20 lines. The server has only 1 gig ram, and runs more serious deamons than I can count with my fingers. Maybe it's the sound of constantly thrashing hard disk that makes this magic possible.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2005, 7:51 pm 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
Chris wrote:
I'm still planning to looking into corrupt's CMDret - Capture Output from Console someday, and possibly integrate it into AutoHotkey if it isn't too difficult.

Good news. I'm OK !!!! :) :) :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2005, 8:17 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
Nalerian wrote:
How do you capture the output from tail.exe into a variable usable by autohotkey? This seems to be my current roadblock on the way to creating a real time parser/reader.
A DLL Version of CMDret is now available here :)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, Maestr0 and 61 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group