Hi I am reading text from pdf and using regex to find the first two words from multiple lines which is in between two lines. Here is the text:
ID Name Quantity Value Description Weight (kg) ADD 160 ADD - Supp- Power Rack Box (RED) 500.00 TDD 260 TDD - Supp - Leaf Green (GREEN) 200.00 ZTP 360 ZTP - Supp - Fire Red (RED) 100.00
Carrier: GST Limited
I want to have output as:
ADD 160
TDD 260
ZTP 360
The multiple lines could be one or many so everytime line gets added or removed it should give me an output accordingly.
I tried using this (?<=Weight\s(kg)\n)(\w+\s+\w+)(?=[\s\S]*?Carrier:\s) but it gives me just one line output as ADD 160
Are you using the Find Matching Patterns activity. If yes then follow the below,
→ Drag and drop the Find Matching Patterns activity.
→ Click on Configure Regular expression option, select the advanced option in the dropdown.
→ Give the Below regular expression in value field,
^[A-Z\s]+[0-9]+
→ Open the Properties of Find Matching Patterns activity and find the Pattern options dropdown. Check the Multiline option also.
→ Create a variable in the Result option in properties.
→ Use for each activity to iterate the output variable to get the each value.
Check the below output panel image for better understanding,
Hi, I have one question. Is there any way we can create datable for the output so that we can store the values to the header ID Name like ADD 160 to header ID and Name?
So sorry I should have analyse more variations before posting. I finally got the variations now… There shouldn’t be any variations apart from it. I hope you don’t mind to have a final look at the below text.
ID Name Quantity Value Description Weight (kg) ADD 160 ADD - Supp- Power Rack Box (RED) 500.00 G5 80 TDD - Supp - Leaf Green (GREEN) 200.00 Bulb 1 ZTP - Supp - Fire Red (RED) 100.00 Bundle KB (25 pcs) 1 ZTP - Supp - Fire Red (RED) 100.00 Bundle PKCTL (18 pcs) 2 ZTP - Supp - Fire Red (RED) 100.00 BD 1 ZTP - Supp - Fire Red (RED) 100.00
Carrier: GST Limited
Is there any way we could get first two words apart from if bundle is present just get KB 1 and PKCT 2 ?
So sorry for inconvenice caused.
Thanks for doing this mate. Almost there. I didnt get the Substitution part how do we do that in studio? Could you check my workflow please. I have just bit confused on how to remove the bundle bit.