Sign in to follow this  
Followers 0
xzaz

Get first row after a string

4 posts in this topic

$Split = stringSplit($line,"<")
                    
                $Output = ""
                For $i = 1 to $Split[0]
                if $i = 1 Then 
                    $NextChar = StringLeft($Split[$i],1)
                    If $NextChar = "/" Then
                        $Output &= $Split[$i]
                    Else
                        $Output &= $Split[$i]
                    EndIf
                Else 
                    $NextChar = StringLeft($Split[$i],1)
                    If $NextChar = "/" Then
                        $Output &= "<"&$Split[$i]
                    Else
                        $Output &= @CRLF&"<"&$Split[$i]
                    EndIf
                Endif
                Next
        _GUICtrlEdit_SetText($EditFile,$Output)

Alright i want to sort This! file. That works, but now i want to copy the first <RLPoint></RLPoint> After the <RedLine>. Im confused. I am sure i need to check the string (i'v put them in a array) if the string is <RLPoint> copy and past the next id.

Could someone give me a punsh into the right direction? Tnx!

Share this post


Link to post
Share on other sites



You need this?

$source = FileRead("c:\helekaart.mrk")

$aString = StringRegExp($source, "^.*(<RLPoint.*</RLPoint>)", 1)

MsgBox(0, "", $aString[0])

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Tnx for the answer, its not quite what i needed but it comes in the right direction. I never used StringRegExp yet. I will go and check that.

The thing i want:

the file i was provided was wrong that file only containd 1 <RedLine> i uploaded an other one witch got mutiple <RedLine>'s in it. After every <RedLine> there are <RLPoint>'s. I need the first <RLPoint> after every <RedLine>.

Hope this is clear, can't explane it better. Tnx for helping again! I realy appreciateit.

Edit: o the file: download

Edited by xzaz

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