Output to new folder
- 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
Hi,
I have an issue with some backups. I'm reading a bunch of tables from a datebase, appending a prefix with a date stamp, and saving them individually as .csv files. Since the flow with these backups is to be run weekly, I would like it to automatically create a new folder with the date as the file name, and output the individual .csv backup files inside this folder.
Is this possible?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @mikirkeby
You could use a Blocl Until Done tool and from the first output, create the folder (either with System Command, or the R tool); then from the 2nd output, write the CSV to that folder.
Hope that helps!
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Something I do is use a formula field to dynamically build a path...
[File Name] = [FilePath] + [Source_FileName] + [FileNameExtension]
...where [FilePath] changes based on file and date, then set my output to take that full path...
Is this the method you're currently using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
How can I automatically create the folder using system command? (I don't R tool in my package)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Just to strip this down so that you can get experience with creating folders - let's do a quick canvas that only creates a folder
Tool 1: text input. Put 1 field in here, and in that you put the command "mkdir c:\temp\foldername". Note- this will fail if c:\temp doesn't exist so that may be step 1.
Tool 2: Run command:
- Set the write source to write to a temporary batch file. This file is created on the fly by the run command with teh command you provided in Tool 1
- Then execute this run command
- Finally - you need to specify a read location - just put any file in there (it uses that to pass on data to the outbound leg). You could re-read the batch file you've just created.
This works like a charm and is very reliable.
Let me know if I need to mock this up for you when I get home?
[cid:image001.png@01D2B919.1720EB40]
[cid:image002.png@01D2B919.3F3D7940]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
A mock-up would be very nice, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here you go Michael,
Stripped this down to the bare bones to demonstrate the concept. Note - this relies on you having a folder on your c:\ called Temp, but you should be able to amend as you need.
Thank you for following up with me - hopefully this solves your problem.
I would suspect that if you need to create some directories, then write a bunch of files, you'll need to wrap this in a macro. If that's the case - shoot over some sample data, and we can take the next step of showing you how to do both the folder creation, and then also writing the data into the files in the subfolder.
Cheers
Sean
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Works Perfectly !!!
thanks @SeanAdams
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi
I have used the Make Directory Batch to create my new folder structure and works great. However I am having trouble ensuring my output dynamically selects this new folder when saving the output.
Any advice?
Regards
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey, I tried running this and it gives me "The external program returned an error code 1"
