cancel
Showing results for 
Search instead for 
Did you mean: 

File name for append processing mode with time stamp

Former Member
0 Kudos

Hi Experts

we are doing file to file scenario using the processing mode as Append.

the requirement for us to append the files and we need to have new file name with time stamp added to the appended file.but in the processing mode of the file adapter either we can append or add time stamp. thatz the problem I am facing now.

we are doing file based processing not message based ,micheal blog regarding the dynamic file name is for message based not for file based.

Please provide your valuable comments.

Thanks

Faheem

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

If you are append you can try this approach:

There will be two proceses involved:

1st process:

The o/p will be a flat file in Append mode.

2nd process:

XI picks up the file after certain time period in Delete mode.

Change the file name to whatever you want with Add Time Stamp mode.

This is one workaround, but you will not have the old file in this case.

--

Srini

Former Member
0 Kudos

Use Dynamic Configuration using variable substitution

Former Member
0 Kudos

Hi mohamed,

I suggest you to map the target source structure to the required filename u want, like for example ur filename is input26062008.txt means to the target structure u perform the following mapping

constant (input) concat with currentdate function --> concat with constant .txt --> map this concat to target. So u will get the filename u expected with the time.

Then in the communication channel u select the mode as append. Now ur requirement will get solve i think so. plz try.

Regards,

Murugavel

anita_r
Explorer
0 Kudos

Hi Murugavel,

Can you please explain clearly how the mapping has to be done (has a field called file name to be added in target structure?) and also how the value of this field will be put in target directory (where this field has to be mentioned in file receiver communication channel?)

Thanks & Regards,

Anita.

Former Member
0 Kudos

HI,

YOu wish to append the data to the existing file as well as need to change the TimeStamp of file name.

Then you can do this with OS Commands. With Communication Channel just append the record and after Processing parameters for OS Commands, just write shell script command to copy the file with new name and then delete the existing file.

Probably you can write this kind Shell script coding.

OR you can go for Customized Adapter Module development.

Thanks

Swarup

Former Member
0 Kudos

Hi

I want change the file name and add the time stamp at the merge of these files.

As per your recommendations, we need to write a unix script to rename the file name and add a time stamp

Please provide me if you have any sample codes for the same.

Thnz

Faheem

Former Member
0 Kudos

if u copy the file with new name and delete the old one then when the next interface comes it won't find the old filename to append the files

so what can be done keep copying the appended file (without deleting) to a new filename (i.e latest timestamp) hence at a given point both filenames have the same data but one with the old filename and other with the new filename containing the latest timestamp

Former Member
0 Kudos

hi,

Both at a time..i think,is not possible...

try with these..

/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping

Dynamic File Name Part 1

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

Dynamic File Name Part 2

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii

Thanks,

Vijaya.