XxXFaNtA Posted February 24, 2006 Share Posted February 24, 2006 Hi everybody I'm new to AutoIt and i've a little question.I tried to open a File and then search for some Keywords and then getting the Text that is after this Keywords.Example:textextext = textHello=Fanta.exetextextext = textmoretext = textHello=Needs.exetext= textothercrap = textHello = Help.exeThe script should search the Keyword Hello and then saving the Text Fanta.exe, Needs.exe, Help.exe ..Can somebody Help me? I did once somethink similar to that (tried making a small chatbot but it has some odd bugs...)..I tried somethink like this:#include <file.au3> $file = FileOpen("C:\myfile.ini", 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ...But somehow if i checked $file it was = 1 It would be nice if someone could give me a hint or help me (like what i have to look for)Thx /[center][/center] Link to comment Share on other sites More sharing options...
KlemsonGuy Posted February 24, 2006 Share Posted February 24, 2006 Check out the help file for IniRead. That should do what you're looking for. Hi everybody I'm new to AutoIt and i've a little question. I tried to open a File and then search for some Keywords and then getting the Text that is after this Keywords. Example: textextext = text Hello=Fanta.exe textextext = text moretext = text Hello=Needs.exe text= text othercrap = text Hello = Help.exe The script should search the Keyword Hello and then saving the Text Fanta.exe, Needs.exe, Help.exe .. Can somebody Help me? I did once somethink similar to that (tried making a small chatbot but it has some odd bugs...).. I tried somethink like this: #include <file.au3> $file = FileOpen("C:\myfile.ini", 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ... But somehow if i checked $file it was = 1 It would be nice if someone could give me a hint or help me (like what i have to look for) Thx Link to comment Share on other sites More sharing options...
ChrisL Posted February 24, 2006 Share Posted February 24, 2006 Do you mean like this? Maybe not exactly what your trying to do but you can modify it I'm sure $File = FileOpen ("MyTextfile.txt",0) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf While 1 $line = FileReadLine ( $File) if @error = -1 then ExitLoop If Stringinstr ($line, "MyString") then FileWriteLine ("MyNewfile.txt", $Line) WEnd FileClose ($File) [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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