Page 1 of 1

Execute Command Function

Posted: Fri Nov 12, 2010 12:14 pm
by avunoori
Hi,

I have a requirement to execute the Unix command and pass the value the next JobActivity

In the Execute command how do I pass the two unix commands
awk -F"|" 'BEGIN{IGNORECASE=1;} $1~/DATA/' #ps_EDW_StdHrs.p_Source_Dir#/*/#ps_EDW_StdHrs.p_Source_FileName# | cut -d"|" -f8,9

Here I read the file and extract only the column 8th and 9th

But Execute Command is not accepting the Parameter in between the Unix command. Could some one can help how to handle this requirement?

Posted: Fri Nov 12, 2010 12:54 pm
by anbu
You can print the eight and ninth field from awk

Code: Select all

awk -F"|" 'BEGIN{IGNORECASE=1;} $1~/DATA/ { print $8 FS $9 } ' #ps_EDW_StdHrs.p_Source_Dir#/*/#ps_EDW_StdHrs.p_Source_FileName# 

Posted: Fri Nov 12, 2010 1:05 pm
by avunoori
Thanks, I will have mutiple records how do I read only 1 record using the Awk Command.

Posted: Fri Nov 12, 2010 1:39 pm
by anbu
Use exit command

Code: Select all

awk -F"|" 'BEGIN{IGNORECASE=1;} $1~/DATA/ { print $8 FS $9; exit } ' #ps_EDW_StdHrs.p_Source_Dir#/*/#ps_EDW_StdHrs.p_Source_FileName#