ODI file append with unix command problem
aetlFeb 27 2013 — edited Mar 14 2013Hi 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