Help with string functions

darbid

Registered User.
Local time
Today, 15:05
Joined
Jun 26, 2008
Messages
1,428
Could someone help me how to get the info I need out of this string.

This is exactly how it is. What is the best way to get out the bits in red?

Internes Aktenzeichen:2009L00263 DEErfassungsdatum:22.04.2009


PIV:BOW Standort:Mch PLand:DE


Anwalt:
Ansprechpartner:
Verhandlungsart: Lizenznahme


Titel:GSM/GPRS Patents
As always thanks heaps
 
Could someone help me how to get the info I need out of this string.

This is exactly how it is. What is the best way to get out the bits in red?

As always thanks heaps

You can use the Instr() and the Mid() functions to get what you want.
Code:
    Instr([StartingPosition], StringToSearch, StringToLocate)
    Mid(StringToSearch, StartingPosition, NumberOfCharacters)

For Instance, Instr(1, StringToSearch, "Aktenzeichen:")+13 gets you the starting position of "2009L00263", and you can work it out from there.
 
You say that this is exactly as it is, as though nothing ever changes, if that is so then 3 Replace statements will suffice, if that is not so what can change, just the data (and length?) of the red bits?

Brian
 
You can use the Instr() and the Mid() functions to get what you want.
Code:
    Instr([StartingPosition], StringToSearch, StringToLocate)
    Mid(StringToSearch, StartingPosition, NumberOfCharacters)
For Instance, Instr(1, StringToSearch, "Aktenzeichen:")+13 gets you the starting position of "2009L00263", and you can work it out from there.
Thanks that will get me started, although I am looking at alternatives.


You say that this is exactly as it is, as though nothing ever changes, if that is so then 3 Replace statements will suffice, if that is not so what can change, just the data (and length?) of the red bits?Brian
You are probably picking up on my utter frustration. I am sorry.
I did mean with spaces and line breaks.

It is coming from reading a webpage and as I am learning and worried about the web page changing I just wanted to take this (which is a table) and get the bits I need out of it. I have since noticed that a couple of them have unique things that I hope will not change.
 
I have written a getpart function some while back.
It uses split() to put the result in an array. You could use ":" as a fieldseparator. It doesn't matter what the exact location is.

Maybe you could use it?
 

Users who are viewing this thread

Back
Top Bottom