Jump to content
Sign in to follow this  
Ashalshaikh

Help

Recommended Posts

Ashalshaikh

Hello !!

First ,, My English Is Baaaaaaad :D:D ,, So I Sorry

Thank you for this wonderful forum

I Want To Script For Read Text File And Select String of text

For Example

Read Text File = Auto'it ' " AshAl" 'sds"sd' Ashalshaikh ' "s" '

I Want To Select This , By Script :P

'it ' & " AshAl" & 'sds"sd' & ' "s" '

How ?? !! ;)

Edited by Ashalshaikh

Share this post


Link to post
Share on other sites
Ashalshaikh

I tried to use The _StringBetween But It's Not Working :D

:D;)

Edited by Ashalshaikh

Share this post


Link to post
Share on other sites
billthecreator

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 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

Share this post


Link to post
Share on other sites
Ashalshaikh

Yes ,, I want text that is between these characters: ' and "

Very Very Very Thank You ,, :D

You helped me a lot ,, :D

Now, I can complete my work ;)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.