Parsing Data from xml URL to a txt file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • jimmy guilfoyle
    Forum Member
    • Oct 2003
    • 40

    Parsing Data from xml URL to a txt file

    Hi Folks

    Its been a long time.

    I used to dabble with version 4 ….a tad on 6 and now we are on Version 7

    I was hoping someone can help me with where to start on this.

    I require to pull a data/response from an xml URL

    The URL is

    Code:
    https://www.adslchecker.bt.com/pls/adsl/adslchecker_xml.telno?Username=XXX&Password=XXXmt&Version=16&AEA=yes&Input=01753823642
    On the above I have masked the fixed username and password with XXX and shown this in text. (I really can’t share them……soz)

    Notice that last part of this is a UK telephone number (01753823642) and in this case it returned the following response.



    So my idea is this. I want to read a txt file; it could be csv with a big long list of DNs telephone numbers, or just one like 01753823642

    For each telephone number I want to take that number (01753823642) and populate this data string onto the URL like the one above, I want to take the xml response and somehow populate this to a CSV results txt file.

    So if I had 10 numbers to process I would have 10 outputs.

    I will always get outputs from the xml URL.

    Code:
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <ADSL_CHECKER>
      <ERRORID>0</ERRORID> 
      <INPUT>01753823642</INPUT> 
      <INPUTTYPE>TELNO</INPUTTYPE> 
    - <FIXEDRATE>
      <RAG>G</RAG> 
      <READYDATE /> 
      <EXCHSTATE>E</EXCHSTATE> 
      <CAPACITY /> 
      </FIXEDRATE>
    - <RATEADAPTIVE>
      <RAG>G</RAG> 
      <READYDATE /> 
      <EXCHSTATE>E</EXCHSTATE> 
      <CAPACITY /> 
      </RATEADAPTIVE>
    - <MAX>
      <RAG>G</RAG> 
      <SPEED>4000</SPEED> 
      <READYDATE /> 
      <EXCHSTATE>E</EXCHSTATE> 
      <CAPACITY /> 
      </MAX>
    - <WBC>
      <RAG /> 
      <SPEED /> 
      <READYDATE /> 
      <EXCHSTATE>N</EXCHSTATE> 
      <CAPACITY /> 
      </WBC>
      <EXCHANGECODE>THSL</EXCHANGECODE> 
      <EXCHANGENAME>SLOUGH MAIN</EXCHANGENAME> 
      <REASONCODE>Z</REASONCODE> 
      <VPCONTENTION>N</VPCONTENTION> 
      <SPNAME /> 
      <CAD /> 
      <CPNAME /> 
      <CPCONTACTNO /> 
      <POSTCODE>SL1 3PT</POSTCODE> 
      <SUGGESTEDMSG>Your exchange is ADSL enabled, and our initial test on your line indicates that your line should be able to have an ADSL broadband service that provides a line rate up to 2Mbps. Our test also indicates that your line currently supports a potential ADSL Max broadband line rate of 4Mbps or greater. The actual ADSL line rate supportable will be determined during the first 10 days of use, after which time the highest stable rate possible will be set. If you decide to place an order, a further test will be performed to confirm if your line is suitable for the service you wish to purchase. Thank you for your interest.</SUGGESTEDMSG> 
      <SUPPLEMENTARYMSG /> 
      </ADSL_CHECKER>
    I have highlighted in green which xml headers I want to see…and if it were easier I could just take them all and filter it in excel….



    Now I really would appreciate some advice on this one as I’m struggling where to start….

    If someone could point me in the right direction I would really appreciate it.

    Thanks again. Nice to be back

    Ive also attached the xml file from the above as an example.

    Cheers

    Jimmy
    Attached Files
  • jassing
    Indigo Rose Customer
    • Jan 2001
    • 3124

    #2
    Have you looked at the XML object?

    Might be easier to use a custom function tho -- looks like the # is wrapped in <input> and </input> just find the 1st occurance of the <input>and then</input> and pull the text between -- then repeat until <input> is not found....

    Comment

    Working...
    X