cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Target file in an hour and append all contents to file to hour generated file

gganesh15051
Explorer
0 Kudos

Hi Team,

I am having requirement that Target file need to be generated in hour and append contents to to that generated file ,For example if i got message at 03.15 then message has to create xx-xx-xx-030000.txt and after processed messages up to 04:00 all payloads need to appended to xx-xx-xx-030000.txt. Could you please share your ideas to achieve this requirement.

Thanks in advance.

Thanks & Regards,

Ganesh Gullipalli.

Accepted Solutions (1)

Accepted Solutions (1)

former_member190293
Active Contributor
0 Kudos

Hi Ganesh!

You could use java code in adapter module, UDF or standard functions in graphical mapping depending of your scenario to get current time stamp, construct file name and put it to Dynamic Configuration as file name. In receiver file adapter use ASMA attribute for file name and set file creation mode to Append.

Thus either new file is created or existing file is appended depending on its name.

Regards, Evgeniy.

gganesh15051
Explorer
0 Kudos

Hi Evgeniy,

Thanks for your suggestions.

I did this requirement by using Dynamic configuration and  ASMA variables, First i have used UDF in message mapping in that i have placed current hour and date as a file name. second, receiver channel kept in append and enable ASMA check box ,then its creates unique filename for every hour and in between hour all messages appended to that first unique file.

Thanks&Regards,

Ganesh Gullipalli.

Answers (2)

Answers (2)

former_member191435
Contributor
0 Kudos

Hi Ganesh,

Try like this...

Use variable substitution and add the current hour like 03 or 04 at the end of the file.  select the option overrideexisting file....

if file create in between  3-4 file name of that file in that time gap FILENAME_03.txt  and if any files comes in between 3-4 it is overwrite the existing file..... after 04 it will create another file with the file name as FILENAME_04.

Thanks,

Sreenivas

former_member190293
Active Contributor
0 Kudos

Hi Ganesh!

What is your sender channel and what moment is considered to be the "time of getting message"?

Regards, Eugene.