Hello!
I searched for a while how to fix my problem but none of the solutions works fine, so I come here hoping some new help
This is an example of string I got in my table :
417720;2;2003;431967;432071;432135;432071;432504;432135;432504;433695
I would like to extract all number of 6 digits in my string and have in return this
417720;2003;431967;432071;432135;432071;432504;432135;432504;433695 (the 2 was removed)
I tried with regex like this in R language
But when it works, it extracts only le first number of 6 digits.
I also tried the str_extract_all but I got everytime some errors.
Do you have any idea to get what I expected please ?
Thanks for your time
I searched for a while how to fix my problem but none of the solutions works fine, so I come here hoping some new help
This is an example of string I got in my table :
417720;2;2003;431967;432071;432135;432071;432504;432135;432504;433695
I would like to extract all number of 6 digits in my string and have in return this
417720;2003;431967;432071;432135;432071;432504;432135;432504;433695 (the 2 was removed)
I tried with regex like this in R language
VBA Code:
# 'dataset' contient les données d'entrée pour ce script
library("stringr")
pattern <- "(([0-9]{6})*[;]*)*"
cleanRegEx <- str_extract(dataset$myCol, pattern)
Anomalies <- within (dataset, {Regex= cleanRegEx})
But when it works, it extracts only le first number of 6 digits.
I also tried the str_extract_all but I got everytime some errors.
Do you have any idea to get what I expected please ?
Thanks for your time