Hello everyone,
I am trying to use RegEx to extract month(10,11,12) from file names. The file names are in the below format-
10 October 2022.xlsx
11 November 2022.xlsx
12 December 2022.xlsx
I need to extract month from the file path string, which looks like this-
D:\Shared\Data\12 December 2022.xlsx|`Sheet1$
Is there a simple way to achieve it?
Thanks in advance!
Solved! Go to Solution.
If the data is as you describe, then I'd first use
FileGetFileName(FullPath): Returns the name portion of the path, without the
That gives you 12 December 2022
Then use:
DateTimeParse([datafromabove],"%d %B %Y)
see: https://help.alteryx.com/20223/designer/datetime-functions
That gives you:
2022-12-12
Things should be doable now.
Cheers,
Mark
Hi, @rajputakansha
This is brute force, and I hope you will get more elegant treatments.
There are two approaches based on the patterns I see in your file path (use spaces or text).
Please wait to mark it as an acceptable solution until better treatments are offered, but it should work for you.
Cheers!
works great! Thank you so much!
You're most welcome @rajputakansha
Regex isn't always the easiest simplest solution. Wouldn't just a text to columns do the trick?