I need to extract the last paragraph from the below text i.e the paragraph starting from Reply. Please note there is no common seperator that I can use. The last paragraph can start with different words like Reply or Internal Note or Remark.
I tried using the Split("\n) method but it did not work.
Internal Note 12345678 06.11.2023 18:04:24
11/6 - Attached signed DR and BOL, signed BOL shows only 6 pallets were
picked up. Requested for cycle count. AAN
Internal Note 3456789 22.11.2023 21:13:13
11/22 - Attached POD documents show that material was picked up by
FedEx. 7 pallets were consolidated into 6 physically. Total weight of
material shipped when picked up equals the weight of material received.
DR also shows all 514 cases received by BBY. Deduction is invalid. To be
collected in full. AAN
Internal Note 23456789 22.11.2023 21:48:13
PRD to be issued.
Reply 123456789 22.11.2023 21:57:07
Please be advised that your deduction of $20,481.48 referencing
DMQ891XXXXXX is denied. The attached shipping documents demonstrate all
the material as having been shipped and delivered (weight of the load
shipped/invoiced is equal to the weight of the load received) 7 pallets
were consolidated physically into 6 pallets, hence the change in # of
pallets. Please remit payment immediately, referencing DMQXXXXXXXXXX on
your remittance advice. Thank you. AAN.
Thanks for your quick solution. The solution you mentioned works if I pass the entire text in an assign activity as a value to input variable. But when I directly extract this entire text from SAP using Get Text activity and the output of that activity is stored in a variable called Inputtext. Then I use another Assign activity where Input variable is LastParagraph = InputText.Split(System.Text.RegularExpressions.Regex.Match(InputText.ToString,“\n\s”).Value).Last
When i do this the value in LastParagraph is the entire text again.
If you extract the text from SAP by using Get Text, the output of Get Text is also String. Then you can use the same expression to get the last Paragraph in the Extracted data… @Rajesh_Yadav
What is the LastPragraph Variable is printing now for you. Are you getting the required output…?
I just did that. Extracted the data from SAP using GetText activity and then stored that string in a Text file using Write Text File activity. Then used a Read Text file activity to read it back again and then applied Regex but still the same.