Jump to content

Help


Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...