website parsing

motleyjew

Registered User.
Local time
Today, 15:03
Joined
Jan 11, 2007
Messages
109
I need some assistance parsing some information from a web address. Here is an example of what the web address is.
-http://www.websitename.com/ct20/pages2/client_bcphone_service_order.aspx?client_id=1603994&contract_document_id=924182&cipid=206123444-

What I am trying to do is get the client ID and the contract id. The client id being 1603994 and the contract id being 924182. Any ideas would be appreciated.

Gregg
 
Last edited:
This will get the job done if the client ID is always 6 characters long and the doc ID is always 6 characters long:
Code:
mid([Website Field Name], instr([Website Field Name], "client_id="), 6) &

   ", " & mid([Website Field Name], 

      instr([Website Field Name], "contract_document_id="), 6)
 
Last edited:
Thanks for the assistance. Here is what I have got from your suggestion:

ID is the field that the web address is in. I am using "document_id" to id the character location and adding 12 to get my start position.

=Mid([ID],InStr([ID],"document_id=")+12,6)

This does work, but I am not sure if the id is always going to be 6 characters.I assume that it will eventually roll over to 7 but I can't be sure. Is there anyway to do the same type of formula that cuts off at a particular character. I can identify where it would need to end but don't know how this can be done.
 
=Mid([ID],InStr([ID],"document_id=")+12,6)

I am not sure if the id is always going to be 6 characters.I assume that it will eventually roll over to 7 but I can't be sure. Is there anyway to do the same type of formula that cuts off at a particular character.
Based on what you've said here, I adjusted the syntax. Use this if you don't know weather the id number will be 6 or 7 characters:
Code:
=Mid([ID], InStr([ID], "document_id=") + 12, 
   iif(isnumeric(mid([ID], Instr([ID], "document_id=") + 17, 1)), 7, 6))
 
Adam,

Thats a great solution , thank you so much. I was not familiar with the isnumeric sytax or that you could use a iif statement within a function like that. I love this forum. Thanks again.

Gregg
 

Users who are viewing this thread

Back
Top Bottom