Hi,
I have a column of data where I need to remove the date and keep the rest. like this 7/24/2020340 ,10/30/20194 , I tried Substring([Releas Date],9) , but as the length of date is varies, it is not working . Any suggestions would be greatly .
Solved! Go to Solution.
Try
REGEX_Replace([Release Date], '\d+/\d+/\d{4}', '')
Note this will only work if the year is always 4 digits
Thank you , it works 😊
what about if I want to have the date in another column ??
As in split the date out? In that case use the Regex Tool in parse output mode and the following code:
(\d+/\d+/\d{4})(.+)
That will place everything after the date in a new field
When you write like this 7/24/2020340 ,10/30/20194
are the two dates on the same row, same column?
or same column, two different rows?
If they are in the same column, two different rows, and
if the Year is always 4 characters...
You can use the RegEx tool with this expression:
.*\/\d{4}(.*$)
which translates to:
.* find any character, zero to unlimited times
\/ followed by a slash (the \/ is because the / slash must be escaped by using the \ character)
\d{4} followed by a digit (\d) exactly 4 times
(.*$) followed by the group of characters you want to capture: any character, zero to unlimited times, followed by end of string ($)
The website https://regex101.com/ helps test regular expressions
or you could try a combination of these functions in a Formula tool:
ReverseString
ReplaceFirst (replace first / with an unusual character like a tilde ~ or a pipe symbot |)
ReverseString
Then use the Text to Columns tool, and use the unusual character as the delimiter
Chris
Thank you , it worked .