on 11-04-2015 10:54 AM
Hi BODS Experts,
We have two requirements in our Project.
Please help us how to resolve this.
Question 1:
We have multiple flat files naming --> Data_<uniquenumber>.csv
Now I have to load data from only one flat file which is created/modified at the latest.
So Please help us how can we write Data Services script language for this scenario.
Question 2:
Once data from the file is loaded, the file will be moved to Archive folder.
After 30 days, the file would be deleted in Archival folder.
So Please help us how can we write Data Services script language for this scenario.
Thanks & Regards,
Muthuram.
Write a command file (.bat file or shell script) to manipulate your files and call these from DS with the exec built-in function. Assign the return value (e.g. the filename) to a global variable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will assume you are doing this on Windows, if not it's even easier.
1. You can use something like this inside your batch script:
for /f %%i in ('dir *.xml /b /o-d') do copy %%i current.xml & goto :moveit
:moveit
next operation...
2. You can use this in your batch script to delete files in your archive directory older than 30 days
forfiles /p \path\to\archive /d -30 /m *.xml /c "cmd /c del @path" 2>nul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.