How to replace a part string value of a column using another column.
My DataSet here is :
ID Product Name Size ID Size Name
1 24 Mantra Ancient Grains Foxtail Millet 500 gm 1 500 gm
2 24 Mantra Ancient Grains Little Millet 500 gm 2 500 gm
3 24 Mantra Naturals Almonds 100 gm 3 100 gm
4 24 Mantra Naturals Kismis 100 gm 4 100 gm
5 24 Mantra Organic Ajwain 100 gm 5 100 gm
6 24 Mantra Organic Apple Blast Drink 250 ml 6 250 ml
7 24 Mantra Organic Apple Juice 1 Ltr Tetra Pack 7 1000 ml
8 24 Mantra Organic Apple Juice 200 ml 8 200 ml
9 24 Mantra Organic Assam Tea 100 gm 9 100 gm
Requirement here is the Product Name
column value is 24 Mantra Ancient Grains Foxtail Millet 500 gm
and the Size Name
column has 500 Gm
. In this case my output will be 24 Mantra Ancient Grains Foxtail Millet
.
If the Size Name
contains in the Product Name
string remove the size name word ignoring the case else no need to take any action.