I have a collection of products for which I need a specific product name shorter than 40 characters. My input product name is a string column longer than 40 characters per item, so I need to make this shorter. I could use some string methods, but in that case some product names could end up in senseless names. As an example, an input name could be 'Cut Resistant Gloves, Size 8, Grey/Black - 12 per DZ' (52). How could I get from this to, as an example, 'Resistant Size 8 Grey/Black Gloves' (34)? Thanks in advance
I would like to end up with a new column in my data frame containing this new product names shorter than 40 characters.
You can modify the logic implemented below as per your requirement: