Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODI file append with unix command problem

aetlFeb 27 2013 — edited Mar 14 2013
Hi everyone,

I will apennd multiple files to a main file in a directory.I wrote jython code like this:

import os
sourceDirectory = "/home/oracle1/Desktop/test"
inFileNames = "#FILE_NAMES"
inFileNamesList = inFileNames.split(" ")
inFileIDS = *"'a','1','2','3'"*
inFileIDSList = inFileIDS.split(",")
i = 0
for item in inFileNamesList:
command ="awk 'BEGIN {OFS=\"" + "#FILE_DELIMITER\"" + "} {print $0,\"[|]\"" + *inFileIDSList* + ",\"[|]\"NR}' " + sourceDirectory + os.sep + item + " >> " + sourceDirectory + os.sep + "#SESS_CURR_TS"
os.system(command)
i = i + 1

Now my problem is here :

Yu can seee my inFileIDS values.Ana I have splitted comma and then first I will write file then *inFileIDSList[i]* and at the and NR

But character a is not written.Number values is appended but character values is not appended.

Why it can be so ?
someone has an idea about this problem
Coluld anyone help me to solve this problem?

Regards
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 11 2013
Added on Feb 27 2013
3 comments
761 views