Archive FileName with Sysdate

Eight Stars

Archive FileName with Sysdate

Hi All,

 

I have a directory where n number of File is present. Now I want to to archive all of them in a Single Archive Zip File in format like this Sysdate_SomethingName.zip. I am trying with below in Archive FileName Path but getting compilation Error:

 

context.ROOT_SRCFILEDIR+"J3/DIGITAL/SPEND"+"/"+J3_DIGITAL_ACTUAL_SPEND_routines.TalendDate.getDate("yyyyMMddHHmmss").zip. Can anyone please help

@rhall_2_0@TRF@vboppudi@manodwhb


Accepted Solutions
Forteen Stars TRF
Forteen Stars

Re: Archive FileName with Sysdate

Try this one (take care of ".zip"):

context.ROOT_SRCFILEDIR+
"J3/DIGITAL/SPEND"+"/"+
J3_DIGITAL_ACTUAL_SPEND_routines.TalendDate.getDate("yyyyMMddHHmmss")+
".zip"

or

context.ROOT_SRCFILEDIR+
"J3/DIGITAL/SPEND"+"/"+
TalendDate.formatDate("yyyyMMdd_HHmmss",TalendDate.getCurrentDate())+
".zip"

Hope this helps.


TRF

All Replies
Forteen Stars TRF
Forteen Stars

Re: Archive FileName with Sysdate

Try this one (take care of ".zip"):

context.ROOT_SRCFILEDIR+
"J3/DIGITAL/SPEND"+"/"+
J3_DIGITAL_ACTUAL_SPEND_routines.TalendDate.getDate("yyyyMMddHHmmss")+
".zip"

or

context.ROOT_SRCFILEDIR+
"J3/DIGITAL/SPEND"+"/"+
TalendDate.formatDate("yyyyMMdd_HHmmss",TalendDate.getCurrentDate())+
".zip"

Hope this helps.


TRF
Eight Stars

Re: Archive FileName with Sysdate

Hi @TRF,

Thanks for your reply. That is working in tfilearchive. Now when I am putting the context.ROOT_SRCFILEDIR+"J3/DIGITAL/SPEND"+"/"+TalendDate.formatDate("yyyyMMdd_HHmmss",TalendDate.getCurrentDate())+"_J3_DIGITAL_SPEND.zip" in ts3put FilePath some compilation error is coming

Forteen Stars TRF
Forteen Stars

Re: Archive FileName with Sysdate

Which one?

You may click on the "Code" tab then click on red rectangle in the right margine to locate the compilation error into source code. And finally, click the cross in the left margin to get the error description.


TRF
Eight Stars

Re: Archive FileName with Sysdate

Hi @TRF@rhall_2_0,

 

FileArchive is working. But When I am putting that in ts3Put It is not working

Forteen Stars TRF
Forteen Stars

Re: Archive FileName with Sysdate

So what, compilation error or runtime error?

Which error, do we have to guess it?


TRF
Eight Stars

Re: Archive FileName with Sysdate

Compilation error it is.I have attached it 

Eight Stars

Re: Archive FileName with Sysdate

Forteen Stars TRF
Forteen Stars

Re: Archive FileName with Sysdate

Where are you using this?

Share the component settings with le line of code as it appear in it.


TRF
Eight Stars

Re: Archive FileName with Sysdate

In ts3Put. Using the same FileName as in tfilearchive.Attached it. @TRF

Eight Stars

Re: Archive FileName with Sysdate

FileName is

context.ROOT_SRCFILEDIR+"+"J3/DIGITAL/SPEND"+"/"+TalendDate.formatDate("yyyyMMdd_HHmmss",TalendDate.getCurrentDate())+"_J3_DIGITAL_SPEND.zip" @TRF

Eight Stars

Re: Archive FileName with Sysdate

Sorry this One

context.ROOT_SRCFILEDIR+"J3/DIGITAL/SPEND"+"/"+TalendDate.formatDate("yyyyMMdd_HHmmss",TalendDate.getCurrentDate())+"_J3_DIGITAL_SPEND.zip" @TRF

Forteen Stars TRF
Forteen Stars

Re: Archive FileName with Sysdate

Should work as soon as context.ROOT_SRCFILEDIR is known.


TRF
Forteen Stars TRF
Forteen Stars

Re: Archive FileName with Sysdate

Which compilation error?

TRF