How to extract data from string

studio

#1

how to extract data from the string:
001 615235199 8906008456554 (GTIN-13) 8906008456554 30G 1 CA 288 / 1 9665.0800 9665.08
Item Description ANBD30G
002 615246609 8906008458022 (GTIN-13) 8906008458022 EA 1 CA 144 / 1 20135.5900 20135.59
Item Description KIT
003 615666049 8907122005666 (GTIN-13) 8906008452785 EA 2 CA 14 / 1 3132.0800 6264.16
Item Description KIT
004 615665979 8906008458039 (GTIN-13) 8906008458039 EA 1 CA 144 / 1 28189.8300 28189.83
Item Description DIAMOND
005 616829169 8906008459487 (GTIN-13) 8906008459487 350 ML 1 CA 72 / 1 11880.0100 11880.01
Item Description SHAMPOO

This data may vary and output should be like:
Variable 1:001,Variable 2:615235199 up to last ,that is on the basis of space. also item description is required. what is the possible way to extract this. Is regex function the way?


#2

Hi @mhk15,

Pattern : (( )|((\d*) \(.*\))|(\d*) \/ (\d*))

split the bold line alone and use this pattern
001 615235199 8906008456554 (GTIN-13) 8906008456554 30G 1 CA 288 / 1 9665.0800 9665.08

Regards, Arivu :slight_smile:


#3

its just providing 3 match strings while using this regex function…


#4

But while using this function only 3 strings are matching.