dickjones007 1 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? Share this post Link to post Share on other sites
UEZ 1,278 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Share this post Link to post Share on other sites
dickjones007 1 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 Share this post Link to post Share on other sites