SOLVED
Extracting the Date in a File
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
KamenRider
11 - Bolide
‎09-07-2023
12:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
HI Guys,
Can someone help me modify the formula below to get the date on the filename. Example
0000220454_20230710_FE_v01.xks
0000110383_20230721_FE_v01.xks
The formula is
DateTimeParse(REGEX_Replace([FileName], '[^\d{8}]', ''),'%Y%m%d')
I also welcome new ideas.
Thank,
Kamen
Solved! Go to Solution.
Labels:
- Labels:
- Common Use Cases
- Date Time
- Workflow
3 REPLIES 3
Prometheus
12 - Quasar
‎09-07-2023
12:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@KamenRider I used a RegEx tool's Parse function with this expression: ^\d{10}\_(\d{8}) then used a Formula tool and applied your expression to the field the RegEx tool created: DateTimeParse(REGEX_Replace([RegExOut1], '[^\d{8}]', ''),'%Y%m%d').
 
 
binuacs
21 - Polaris
‎09-07-2023
01:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@KamenRider One way of doing this
Prometheus
12 - Quasar
‎09-07-2023
01:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Oh yes. This is great because it creates a nested expression to parse and create the date in one.
![](/skins/images/9AF25434D4F136B28264A96CA92E8A93/responsive_peak/images/icon_anonymous_message.png)