Ashalshaikh Posted June 16, 2009 Share Posted June 16, 2009 (edited) Hello !!First ,, My English Is Baaaaaaad ,, So I SorryThank you for this wonderful forumI Want To Script For Read Text File And Select String of textFor Example Read Text File = Auto'it ' " AshAl" 'sds"sd' Ashalshaikh ' "s" ' I Want To Select This , By Script 'it ' & " AshAl" & 'sds"sd' & ' "s" ' How ?? !! Edited June 17, 2009 by Ashalshaikh Link to comment Share on other sites More sharing options...
Ashalshaikh Posted June 17, 2009 Author Share Posted June 17, 2009 (edited) I tried to use The _StringBetween But It's Not Working Edited June 17, 2009 by Ashalshaikh Link to comment Share on other sites More sharing options...
billthecreator Posted June 17, 2009 Share Posted June 17, 2009 (edited) what are you exactly asking? you want text that is between these characters: ' and " ? if that, then Local $NewString Local $SepChar = " & "; change to disired seperation format $text = FileOpen("file.txt",0) $text = FileRead($text); Auto'it ' " AshAl" 'sds"sd' Ashalshaikh ' "s" ' $NewText = StringSplit($text, "") $t = 1 ; The following do - until will go through each character until ' or " ; shows up, if they do, it will add every character to a newstring, until ; the same ' or " shows up. Do If $NewText[$t] = "'" Then Do $NewString &= $NewText[$t] $t += 1 Until $NewText[$t] = "'" $NewString &= $NewText[$t] & $SepChar EndIf If $NewText[$t] = '"' Then Do $NewString &= $NewText[$t] $t +=1 Until $NewText[$t] = '"' $NewString &= $NewText[$t] & $SepChar EndIf $t += 1 Until $t = UBound($NewText) MsgBox(0, "New String", StringTrimRight($NewString, StringLen($SepChar))) by the way. for some reason, i felt like being nice, it took my an hour to figure out, and i got it to work. that was f***in' hard. ugh You're very welcome Edited June 17, 2009 by billthecreator [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
Ashalshaikh Posted June 17, 2009 Author Share Posted June 17, 2009 Yes ,, I want text that is between these characters: ' and " Very Very Very Thank You ,, You helped me a lot ,, Now, I can complete my work 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