I have a data set contains a text field that has a date embedded within the text. The goal is to fetch the date from that text. I had used DateTime parse tool to extract date from text but it did not work. So please provide me solution that how I can extract date from the lines of string statements.
The following attachment have input data with respective its output.
Solved! Go to Solution.
I would suggest the Parse tools, specifically RegEx and DateTime tools.
RegEx = Use the following expression to split out the date from the string:
(\d{2}-[[:alpha;]]{3}-\d{4})
Use Parse method to put the results in a new field. RegEx will find the portion of the string that has 2 digits, a hyphen, 3 letters, a hyphen, and 4 digits, and put that in the parsed field.
DateTime = Use the DateTime tool to put the date in the right format. You'll just need to specify the format of the incoming date, so in this case it would be dd-Mon-yyyy. The tool will convert it to standard DateTime format, yyyy-mm-dd.
See workflow attached below... hope that helps!
NJ
Thank You Nicole Johnson.
Your Solution worked. Please suggest me where I refer syntax for regular expression.
Just a note for others landing here:
Nicole's attached example works fine, but the RegEx in the text of the reply as a semicolon instead of a colon after "alpha".
Thanks for the helpful response, @NicoleJohnson!
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
5 |