cancel
Showing results for 
Search instead for 
Did you mean: 

OS command to get file name

Former Member
0 Kudos

Hello All,

Using a single receiver communication channel I have to generate 2 output files.

One output file name is OUTPUT.txt and the second output file name is OUTPUT<YYYYMMDD>.txt

I am generating first output file name using standard file name scheme.

And for generating second output file name I am using Run OS command option.

can some one tell me the OS command to get the file name OUTPUT<YYYYMMDD>.txt?

Thanx,

Regards,

Moorthy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Select the 'AddTimeStamp' in file construction mode in receiver file channel.

The file will be created as OUTPUT<YYYYMMDD>.txt.

Now in 'Run OS command' call the copy command to copy the file with name OUTPUT.txt

http://www.itd.umich.edu/itcsdocs/s4148/

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Moorthy,

There is no way to create two files with different file naming conventions using the same communication channel.

You need to create two different communication channel and add the timestamp using the option file construction mode.

Else if you would like to change the naming of the file then you need to have some differentiation between the two files. So that you can use the OS commands to rename the file.

Thanks,

saravanan_a
Active Participant
0 Kudos

Hi Dasika

Try the scenario by creating 2 receiver communication channel.. I dont think its possible with single receiver communication channel.. If you use add timestamp,it will surely added to both output files.

Former Member
0 Kudos

We would really like like to know how you are going to create 2 file (with different names) using same CC.

If you are going to use "Add timestamp" then both the files will have timestamp at the end (unlike your requirement for the first file).

I think its better to create 2 CC ..first with output.txt and the other OUTPUT<YYYYMMDD>.txt

Also, please tell us more about ur requirment..if the content is same then..u can simply use a CC and use OS command (after processing option ) to copy it to the other location with required file name (OUTPUT<YYYYMMDD>.txt)

Something like this if u r using unix system and both the files are at same location:

cp OUTPUT.txt OUTPUT2.txt