Hi Folks,
I have a automation problem. I am reading PDF file and the I am getting the data in this form.
Notice Of Change Of 6232452-OC1920580
Address For Service- GRIGORYEV
Instrument
Notice Of Change Of 6201481-SC1511463
Address For Service- NACCARATO
Instrument
Notice Of Change Of 6325041-PR3201180
Address For Service- SYMONS
Instrument
Notice Of Change Of 6344395-AT4948713
Address For Service- PARTOZA
Instrument
I want data in this form:
Notice Of Change of Address For Service-Instrument 6232452-OC1920580 GRIGORYEV
Notice Of Change of Address For Service-Instrument 6201481-SC1511463 NACCARATO
Notice Of Change of Address For Service-Instrument 6325041-PR3201180 SYMONS
Notice Of Change of Address For Service-Instrument 6344395-AT4948713 PARTOZA
How do I achieve this? Please provide your thoughts that how we can manipulate the string to get the desired results! Thanks.
You can wither join them together and use it…if they are separate even more good…for eqch line you get …you get either of them…when you get line with ‘notice of change’ then start building your string …when you get ‘address for service’ append the string and when you get instrument it means next string will start so your first is completed
First, I took the whole text you mentioned in the post in a notepad and read that in the strInput String variable.
Then I have split the whole text with respect to the Uppercase word “INSTRUMENT” and put them into a List of String
Finally, I removed all other words and kept only the notice number and printed the desired output with String Concatenation for each item of the list.
“Notice Of Change of Address For Service-Instrument “+item.ToString.Trim.Replace(“NOTICE OF CHANGE OF”,””).Trim.Replace("ADDRESS FOR SERVICE- “,” ").trim