dickjones007 Posted May 8, 2011 Share Posted May 8, 2011 is it possible to write the code that will open text file, then find specified word and move cursor to it. then select all text after that word and delete it? Link to comment Share on other sites More sharing options...
UEZ Posted May 8, 2011 Share Posted May 8, 2011 (edited) Try this: If @OSArch = "X64" Then $au3dir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\AutoIt v3\AutoIt", "InstallDir") Else $au3dir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") EndIf $sFile = FileRead($au3dir & "\Examples\_ReadMe_.txt") $sSearch = "installed." $sLen = StringLen($sSearch) - 1 $sNew = StringLeft($sFile, StringInStr($sFile, $sSearch) + $sLen) MsgBox(0, "New Text", "Before: " & @LF & $sFile & @LF & @LF & "After: " & @LF & $sNew) It will load the _ReadMe_.txt from AutoIt\Examples dir, search for "installed." and copy the text from start until "installed.". Br, UEZ Edited May 8, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
dickjones007 Posted May 8, 2011 Author Share Posted May 8, 2011 Try this: If @OSArch = "X64" Then $au3dir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\AutoIt v3\AutoIt", "InstallDir") Else $au3dir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") EndIf $sFile = FileRead($au3dir & "\Examples\_ReadMe_.txt") $sSearch = "installed." $sLen = StringLen($sSearch) - 1 $sNew = StringLeft($sFile, StringInStr($sFile, $sSearch) + $sLen) MsgBox(0, "New Text", "Before: " & @LF & $sFile & @LF & @LF & "After: " & @LF & $sNew) It will load the _ReadMe_.txt from AutoIt\Examples dir, search for "installed." and copy the text from start until "installed.". Br, UEZ thanks very much that was a lot of help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now