Output File Name
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
How do I setup the output file name to automatically change the date portion based on the Input file name. For example, the input file is named 2021-04-30 GL 331115 State. I want the output file name to be 2021-04-30 CR TX Gasoline Workpapers.
Only the date changes, the rest of the file name is always the same. I tried looking up other post about this, but they are not quite the same.
Thank you,
Laurie
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Lauriek
Depending on the type of file you're outputting to this might change slightly, but generally you can use a formula tool to create a file name, and then in the output tool use the settings to take the filename from a field in the data. For this instance you will want to do the following:
- Make sure the input filename is read into the data (this is a setting on the input tool)
- Use a formula tool to either make a new field or modify that field. If the file name is going to consistently start with a date in yyyy-mm-dd format, you can do something simple like Left([File Name],10)+" CR TX Gasoline Workpapers.csv". (example is csv but whatever file extension is needed can be put)
- In the output configure the file name settings to update either the full path or file name.
- Note: If you're doing excel, you may need to tweak the above to include the full file path/tab name for it to work. CSV would not need this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Bring the filename into your workflow and edit it via regex_replace as attached.
note @Luke_C 's way works too assuming relatively static filenames.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Lauriek ,
I'm assuming you're loading in Excel files, so in your input tool, select from the dropdown to bring in the filename as a field:
Then, on that field you can use the regex tool to remove the existing date, then a formula tool to add today's date to the start of the filename:
Hope this helps,
M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
Both files are excel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Luke_C,
Both input and output files are excel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
