Jump to content

read the string inbetween 2 strings


Sandhya
 Share

Recommended Posts

#Include <File.au3>
#Include <String.au3>
#Include <Array.au3>

$vFile = @ScriptDir & "\cmp.txt"

Local $aFile
Local $aFinal[0]

_FileReadToArray($vFile, $aFile)

For $i = 1 to $aFile[0]
    $sTemp = _StringBetween($aFile[$i], "All selected attributes", "Long identifier")
    If $sTemp <> 0 Then _ArrayAdd($aFinal, $sTemp[0])
Next

_ArrayDisplay($aFinal)

I love this, it helped me alot, but, my txt file has more then 40+ strings that match. How i can get only one match

Edited by dersiniar
Link to comment
Share on other sites

24 minutes ago, dersiniar said:
#Include <File.au3>
#Include <String.au3>
#Include <Array.au3>

$vFile = @ScriptDir & "\cmp.txt"

Local $aFile
Local $aFinal[0]

_FileReadToArray($vFile, $aFile)

For $i = 1 to $aFile[0]
    $sTemp = _StringBetween($aFile[$i], "All selected attributes", "Long identifier")
    If $sTemp <> 0 Then _ArrayAdd($aFinal, $sTemp[0])
Next

_ArrayDisplay($aFinal)

I love this, it helped me alot, but, my txt file has more then 40+ strings that match. How i can get only one match

Figured out allready, 

Local $Result = $aFinal[1]
MsgBox(0, "Price", $Result)

 

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