Good Morning,
When I normally parse a string or csv I use the split feature and the delimiter used (I normally use the ">" symbol as commas come up quite often and mess it up).
However I now have the problem of trying to parse data that someone sends me and I don't have any control over the format, and it doesn't use a delimiter!
It is set out in a standard format, so there are certain sentences in the string that I can use as a reference point, however I am unsure of how to do this.
I should mention i copy the string into a memo field on a form, I am then looking to press an event button and use vba to take the required data and enter it into my relevant fields.
If anyone could please help me to isolate the text from the string I would be very greatful, I have turned bold the text that can vary in both character length and number of lines used - and that I am trying to extract, everything that remains "unbold" is fixed and never changes....
There is another format that they send, which also has a second address mentioned, however i hope if the above can be cracked then i can do the rest on my own.
I was thinking of approaching the code in the following manner:
however this obviously doesnt work, and I am stumped! Any ideas would be a godsend!
Thank you for taking the time to read this
Dean
When I normally parse a string or csv I use the split feature and the delimiter used (I normally use the ">" symbol as commas come up quite often and mess it up).
However I now have the problem of trying to parse data that someone sends me and I don't have any control over the format, and it doesn't use a delimiter!
It is set out in a standard format, so there are certain sentences in the string that I can use as a reference point, however I am unsure of how to do this.
I should mention i copy the string into a memo field on a form, I am then looking to press an event button and use vba to take the required data and enter it into my relevant fields.
If anyone could please help me to isolate the text from the string I would be very greatful, I have turned bold the text that can vary in both character length and number of lines used - and that I am trying to extract, everything that remains "unbold" is fixed and never changes....
Code:
Comany Name
Thank you, payment for your order has been accepted.
Item Name Quantity Price Total
[B]HYT100-14 Inch Electric Push Lawnmower 1 £156.28 £156.28[/B]
--------------------------------------------------------------------------------
Subtotal £156.28
Shipping is Shipping £0.00
Tax (Inc) £23.28
Payment method is 'Protx'
--------------------------------------------------------------------------------
Currency is British Pound Total £[B]156.28[/B]
Your details are shown below for order ref: [B]RC2789995[/B]
Title [B]Mr[/B]
First Name [B]Joe[/B]
Last Name [B]Bloggs[/B]
Address 1 [B]3 Anywhere Road[/B]
Address 2 [B]Anywhere Place[/B]
Town [B]LUTON[/B]
County [B]Beds.[/B]
Postcode [B]LU4 9TE[/B]
Country UNITED KINGDOM
Telephone [B]01234 567890[/B]
Email [B]email@emailworld.com[/B]
--------------------------------------------------------------------------------
Company Name
Company Address
--------------------------------------------------------------------------------
There is another format that they send, which also has a second address mentioned, however i hope if the above can be cracked then i can do the rest on my own.
I was thinking of approaching the code in the following manner:
Code:
me.customertitle.value = Split(StringField, "Title ")(0)
however this obviously doesnt work, and I am stumped! Any ideas would be a godsend!
Thank you for taking the time to read this
Dean