Lon Posted September 5, 2007 Report Share Posted September 5, 2007 Using ME I have notepad open with a large text file. I am using the "find" command in Notepad to locate the specific phrase "Closing case" Everything good to here. What I need to be able to do is to capture the whole text line (has dates, path, etc) "closing case" resides on and save it to a variable. What I am having a problem with is the actual selection of the whole line of text. I don't know of any commands to get the whole line "blued" to copy it. I don't know of any shortcut keys to get the whole line. Any ideas? Quote Link to comment Share on other sites More sharing options...
kevin Posted September 5, 2007 Report Share Posted September 5, 2007 To highlight a line in Notepad you need to do a Shift Down, Arrow Down, Shift Up. Depending on where 'closing case' appears on the line you may need to do a Home first. Once the line is highlighted you can copy it to the clipboard and then copy from the clipboard to a variable. Something like this: Text Type: <HOME><SHIFTD><ARROW DOWN><SHIFTU> Text Type: <CONTROL>c Variable Set String %T1% from Clipboard You may discover that you need some slight delays: Text Type: <HOME><SHIFTD><ARROW DOWN><SHIFTU> Delay 0.1 Seconds Text Type: <CONTROL>c Delay 0.1 Seconds Variable Set String %T1% from Clipboard Another completely different approach would be to use the Text File Begin/End Process commands, like this: Text File Begin Process: "test.txt" If Variable %T1% contains "closing case" Break End If Text File End Process // Here T1 contains the line that has 'closing case' on it This method could be much quicker since you do not have to open Notepad. Quote Link to comment Share on other sites More sharing options...
Cory Posted September 6, 2007 Report Share Posted September 6, 2007 I always use the last example Kevin suggested. Don’t be intimidated it’s actually a lot simpler and you will slap yourself in the forehead when you realize how much better it is. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.