I have a word document of about 5 pages. In the word document, there’s a section that says 'Attorneys to be billed at $6, partners to be billed at $7, paralegals to be billed at $10. How do i get these dollar amounts separately? I want to get them out in this format- Attorneys = $6, partners =$7 paralegals = $10.
In this case your string standard format in the all the pages its easy to get the value using split option.
StrValue=" Attorneys to be billed at $6, partners to be billed at $7, paralegals to be billed at $10"
Create one array variable arrValue(string)
After this you know 3 values need to get
1st value is
"Attorneys to be billed at $6"
Here you can replace the string
Attorneys= arrValue(0).ToString().Replace("Attorneys to be billed at ","")
The same way you can get the other values also.
Thank you for your prompt reply. Is there a way to search for the word ‘Attorneys’ in the whole word document and then get the first occurence of the dollar amount and then do the same for partners and paralegals? So when it finds partners it then gets the first occuring dollar amount after the word 'partners?
So for in this case you can use regex to get the data.
By using this command you can get Amount value
after that iterate the output you can get the solution what you want
This might helps you along with arivu and hemanth solutions.
Attorneys to be billed at $6, partners to be billed at $7, paralegals to be billed at $10
Code : ASSIGN String str =
String.Join(" ",(From item In str1.Split(CChar(",")) Select item.Trim.Split(CChar(" ")).First+" = "+item.Trim.Split(CChar(" ")).Last))
Attorneys = $6 partners =$7 paralegals = $10
How to get sub-string from string-data, where sub-string is dynamic each time when it loads on a webpage?