Jump to content

Trim a String from a 2D array


Vaeb
 Share

Recommended Posts

Hi!

This is a part of my script:

$aTableData = _IETableWriteToArray ($oTable, True)
    _ArrayDisplay($aTableData)
            $pr = StringInStr($aTableData[0][2], "ZRH.", 1)
                                                $pr2 = StringTrimLeft($pr,20)
            MsgBox(0,"0",$pr2)

In Row[0], Col 2 is this:

CODE
Allgemeine Nummern

Firma|NameBereichAbteilungTelefonFunktion

Fam NameLernender Informatikfirm IT +41 58 239 22 18 Informatiker|Fam Name(fni)

Name:Fam Name

Funktion: Informatiker

Number :ZRH.WAI.003.470

Street:blastreet 12

PLZ:7202

Telefon:+41 58 392 22 38

Fax:+41 58 392 22 39

I need to get the part between Number and Street.

What did i do wrong?

Greets

Vaeb

Edited by Vaeb
Link to comment
Share on other sites

I wouldn't bother with the StringInStr() and do this:

$pr2 = StringTrimLeft($aTableData[0][2],8)

This will just strip off "Number :" from "Number :ZRH.WAI.003.470" leaving you with "ZRH.WAI.003.470"

EDIT: I was under the assumption that $aTableData[0][2] only contained one line, but looking at your code again it looks like it contains ALL of the text you posted.

Maybe...

$aTableData = _IETableWriteToArray ($oTable, True)

_ArrayDisplay($aTableData)

$pr = StringInStr($aTableData[0][2], "ZRH.", 1)

$pr2 = StringMid($aTableData[0][2],$pr,20)

MsgBox(0,"0",$pr2)

Edited by weaponx
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...