Text Extract

Need to extract (0,40),(12,96),(1,08),(1,92) from below text, need regex patter

^
10-240 888802066 MKD SLE G 1,5X1,25
20 PC 0,02/1 0,40
Order no.: 50093570
content of 869198212
Confirmed Delivery date 29.08.2023
^
10-250 888800667 CMLKROL CIROPOT LE4-NMKM/3X0,75
16 m 0,81/1 12,96
Order no.: 50093570
content of 869198212
Confirmed Delivery date 29.08.2023
^
10-260 888800251PLOLKJCS LEPO CLE NYAF10 -GKPLGRUEN
2 m 0,54/1 1,08
Order no.: 50093570
content of 869198212
Confirmed Delivery date 29.08.2023
^
10-270 888809013 CLE SOE 2R/6 KLOUKE
6 PC 0,32/1 1,92
Order no.: 50093570
content of 869198212
Confirmed Delivery date 29.08.2023
^

Give a try with this regex : \s[0-9]+[,][0-9]+$

Hi @Swetha_MN ,

Try the following regex:

\/\d\s([0-9,]+)

The group 1 value will give you the desired result

Regards,

there are spa


ces which are missed in the text i posted, please check this screenshot

@Swetha_MN ,

Modified, try this:

\/\d\s+([0-9,]+)

Regards,

there are spaces before, kindly check this

I am getting /1 …value, can we get only the required value,(0,40),(12,96),(1,08),(1,92)

@Swetha_MN ,

Give this a try:

(?<=\/\d)\s+([0-9,]+)

Regards,

@Swetha_MN Is this what you want?

(?<=\/[0-9]{1} )[0-9]+,[0-9]+

@yikwen.goo yes, but there are spaces in the line starting

@Swetha_MN Oh then use this, just moving \s+ to outside the brackets. This will also capture the spaces in the output, but can be easily removed by using Trim.

(?<=\/[0-9])\s+[0-9]+,[0-9]+

@Swetha_MN ,

(?<=\/\d)\s+([0-9,]+)

image

Regards,

Thank you, @vishal.kp @yikwen.goo

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.