boozy
May 21st, 2010, 08:05 AM
Hello,
I have problem with extracting text form line.
Source text look like this:
PC - IBM
Title: order
Description: normal Car Repair AS, reg. 10343234 101
Car Repair , Wall Street, New York 43434
I need to, extract data from those fields. I cannot do it with Length, in every case is the data different. Invariable (data that do not change) are "Title:", "Description:", "reg." and spaces.
I managed to extract the invariable "reg." 8 charters after text "reg."
'Search and extract reg.
strSearch = "reg. "
intWhere = InStr(.Value, strSearch)
If intWhere Then
.SetFocus
.SelStart = intWhere + 4
.SelLength = 8
'.SelLength = Len(strSearch)
TReg.Value = .SelText
End If
But I can`t figure out how to extract Company name, in this case - Car Repair AS. I assume that it can be done with space. Display data between "second space" and ","
Can anyone help me on this one ? Thank you
My apologies for my poor writing skills.
I have problem with extracting text form line.
Source text look like this:
PC - IBM
Title: order
Description: normal Car Repair AS, reg. 10343234 101
Car Repair , Wall Street, New York 43434
I need to, extract data from those fields. I cannot do it with Length, in every case is the data different. Invariable (data that do not change) are "Title:", "Description:", "reg." and spaces.
I managed to extract the invariable "reg." 8 charters after text "reg."
'Search and extract reg.
strSearch = "reg. "
intWhere = InStr(.Value, strSearch)
If intWhere Then
.SetFocus
.SelStart = intWhere + 4
.SelLength = 8
'.SelLength = Len(strSearch)
TReg.Value = .SelText
End If
But I can`t figure out how to extract Company name, in this case - Car Repair AS. I assume that it can be done with space. Display data between "second space" and ","
Can anyone help me on this one ? Thank you
My apologies for my poor writing skills.