cancel
Showing results for 
Search instead for 
Did you mean: 

File to File scenario create extra empty File

Former Member
0 Kudos

Hi, I have a file to file scenario i receive two types file (ABC* and ZXC*) and i don't do any mapping just copy the files. And i also want to create a new empty file.

For example

'ABC123.TXT' I reciced. I copied 'ABC123.TXT' and I want to create an empty file 'ABC123.TMP' at the same directory.

'ZXC321.TXT' -> 'ZXC321.TXT' and 'ZXC321.TMP'

How can I do that ?

Accepted Solutions (0)

Answers (2)

Answers (2)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Create a script as below and call it as OS command in the adapter

#!/bin/sh
cat > yourfilename

Refer this link for writing the script

http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature

Former Member
0 Kudos

I forgot the say my senario is actualy ftp to ftp and i want to create file same name that i received file name but extension is different ABC.TXT -> ABC.TMP

baskar_gopalakrishnan2
Active Contributor
0 Kudos

One way is using Variable substitution in the receiver file adapter, you can specify the output filename as you want. Then the same filename with diff type extension pass it to shell script as an argument.

Variable Substitution details search in the forum. One sample is this [link|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13864] [original link is broken] [original link is broken] [original link is broken];

Former Member
0 Kudos

You can use a OS Command after processing, in receiver file CC to create the empty file.

Something like this:

cat > $1.tmp
^d

Where $1 is a parameter with file name that you need to create (eg. sh SHELL.sh ZFileName ).