Need help regarding string manipulation,
I want to read each line that starts with ‘Task’ in the below string.
further,1. I have to pick-the initial no,i.e between ‘task:’ and ‘description’.
2.I have to capture the code between 'description: and ‘-’,
3.extract text between ‘-’ and Price.
What I did is first used used regex pattern '"(?<=" + labelBefore + “)(.*?)(?=” + labelAfter + “)” and removed whatever is above ‘Task’ and before ‘Thank you’
then splitted data on the basis of string.split(“Task”) and used for each to get ‘item’-each row.
Now how to extract the values from item(one row).
below is the input string:-
This is regarding reference number 826123, the following info have been identified:
Task: 18212402 Description: 121 - gas leakage ,not completed Price: $98.50
Task: 32321720 Description: Rejected Price: $0.00
Task: 34017280 Description: 131 - This will be repaired once spare available Price: $38.50
Task: 66017240 Description: 139 - sent for repair Price: $16.50