SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Feb 2005
    Posts
    246
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    outertext extraction

    I extract the outer text from a web table that contains nested tables, like below.
    val1⌂⌂val2⌂⌂⌂⌂val3⌂⌂⌂⌂val4

    The string above is actually made up of the first row/cell of a seperate table, so when it is copied into an excel or text document it is displayed
    val1
    val2

    val3

    val4

    I would like to extract the second value.

    The problem is I dont how.

    I always know the first value, but how do I use vbs to find the second value. I know I could try and find the first occurance of a value after the first because of the row seperator but I cant fathom the code.

    I suppose my question is - How do I recognise this row seperator?

    Any guidance would be greatly appreciated.
    http://insidesqa.blogspot.com
    QTP, Selenium, Agile, CMMi, Test Architecture

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: outertext extraction

    Use the split function available in VBSCript

    dim allValues()

    allValues=Split("A|B|C|D","|") would seprate the string into an array ("A","B","C","D"} using "|" as the delimiter

  3. #3
    Senior Member
    Join Date
    Feb 2005
    Posts
    246
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: outertext extraction

    Hi Tanrun, thanks for the answer but this way doesnt seem to work with this string. I was trying using various variations of dilimiter recognition but I cant recocognise the character in use. its obviously a new line character, but which?
    http://insidesqa.blogspot.com
    QTP, Selenium, Agile, CMMi, Test Architecture

  4. #4
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: outertext extraction

    Try splitting on vbLf, vbCr or vbCrLf.

    Mark Smith.

  5. #5
    Senior Member
    Join Date
    Feb 2005
    Posts
    246
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: outertext extraction

    Hi tanrun & Mark.

    Thanks both for you replies. I had tried with most of the above mark, with no success Then I discovered that I was working with the wrong string variable.. oops

    it was in fact the vbCr that I split it on.
    allValues=Split("A⌂B⌂C⌂D",vbCr)
    Thanks
    http://insidesqa.blogspot.com
    QTP, Selenium, Agile, CMMi, Test Architecture

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:12 PM.

Copyright BetaSoft Inc.