I would like to remove unnecessary information from a column, with the aim of totaling the amount.
Col_X currently has multiple sections within a whole, split by their 5 digit segment "19651". The segment numbers need to be removed, the Currency needs to be moved to a new column, and the numbers totaled.
So for the last section, it should have two columns reading
Col_X | CCY
429.34 | EUR
Col_X
19651: 10 GBP
19662: 1.2 GBP
19663: 6 GBP
19852: 108.88 EUR
19926: 147 EUR | 39927: 86.9 EUR | 39928: 49.35 EUR
19994: 30.95 EUR | 29990: 298.4 EUR | 19996: 99.99 EUR
I have tried to remove the first section of numbers, but this fails - so i am struggling to work out how to remove them in between the key data i need.
Col_X <- gsub("^.?:","",bill$Col_X)
the first part of the code is failing to remove any numbers from the start.