Page 1 of 1

Using dynamic file names in UniversalDataWriter

Posted: Thu Feb 06, 2014 11:44 am
by kmsrihari
Hi,

I've a requirement to decide output file names dynamically like file name appended by current date-time. Is this possible with UniversalDataWriter? I went through a couple of related posts in the forum, but they were a little unclear to me.

Any help would be highly appreciated.

Thanks,
Sreehareesh

Re: Using dynamic file names in UniversalDataWriter

Posted: Thu Feb 06, 2014 1:41 pm
by imriskal
Hello Sreehareesh,

This goal can be achieved very easily using parameters.

1. Create new parameter TODAY with value `date2str(today(),"yyyy-MM-dd")` (Note that I have used back quotes syntax allowing me to use CTL1 functions within parameters.)
2. Set File URL in UniversalDataWriter to ${DATAOUT_DIR}/output-${TODAY}.txt
3. The result file is in data-out directory and it is named output-2014-02-06.txt

Is this solution sufficient for you?

Kind regards,

Re: Using dynamic file names in UniversalDataWriter

Posted: Sat Feb 08, 2014 5:04 pm
by kmsrihari
Hi,

It makes perfect sense!
Now I'm able to get it worked with your solution.
Thanks a lot for your valuable help.

Thanks,
Sreehareesh

Re: Using dynamic file names in UniversalDataWriter

Posted: Fri Apr 11, 2014 10:54 am
by rz4qk4
Hi,
I also would like to use the some solution, but wanted to have different date (ex: today+1 or today-1), I tried by using others date function to apply in your solution with value `date2str(dateAdd(today(),1,day),"yyyyMMdd")` but failed, any suggestion?

Thanks,
Michael.

Re: Using dynamic file names in UniversalDataWriter

Posted: Fri Apr 11, 2014 3:02 pm
by imriskal
Hello Michael,

Please note that CTL1 has to be used in parameters. And in CTL1, the name of dateadd function is defined with lower case "a" as opposed to CTL2 where dateAdd is defined with upper case "A". Change this one character and your expression should be ok.

Regards,

Re: Using dynamic file names in UniversalDataWriter

Posted: Tue Apr 15, 2014 10:46 am
by rz4qk4
Hi,

It's work perfectly fine now, thanks~

Michael.

Re: Using dynamic file names in UniversalDataWriter

Posted: Tue Dec 22, 2015 8:32 am
by siddhant
hi guys,

i want to dynamically attach a id from a database or to my http file URL
can some body pls help

Re: Using dynamic file names in UniversalDataWriter

Posted: Mon Jan 04, 2016 4:10 pm
by slechtaj
Hi,

I believe this question was answered as part of this thread. Or is there anything else you need to clarify?