Hi All,
i have 20 Obligors when ever i dont find all of them on particular row/line from each in put i need to print it in different file.
using below command but it is not working please help at earliest.
Steps:
set -A FILENAME $( cat $config_file_path/crt_extracts_branch_gswid_cntl | grep -v "^#" | awk '{ print $1 }')
set -A COLPOS $( cat $config_file_path/crt_extracts_branch_gswid_cntl | grep -v "^#" | awk '{ print $4 }')
#Carrs Extract File Column Position Control File column position GSWID Column Possition
##############################################################################################################################################
Assessment_Extract.txt 4 0-17 3
$ cat GERMANY_Obligor_filter_ctl
##Obligor information file
##For new obligor for search contion add "|| $colpos != xxxxxx" in format
##make sure all condition values in single line
$colpos != 228070 || $colpos != 228071 || $colpos != 228072 || $colpos != 228073 || $colpos != 228074 || $colpos != 228075 || $colpos != 228076 || $colpos != 228077 || $colpos != 228078 || $colpos != 228079 || $colpos != 228080 || $colpos != 228081 || $colpos != 228082 || $colpos != 228083 || $colpos != 228084 || $colpos != 228085 || $colpos != 228086 || $colpos != 228196 || $colpos != 228199$
ifcondition_val=$( grep -v "^#" $config_file_path/GERMANY_Obligor_filter_ctl)
command_construction=$( echo "cat \$SOURCE_DIR/\${FILENAME[\$x]} | awk -F\"|\" -v colpos=\"\${COLPOS[\$x]}\" 'if (\"\$ifcondition_val\") { print \$0 }' > \$NEWFILENAME")
eval $command_construction
please help me how to achieve it. i am trying to assign values dynamically. how to compare column position value in "if then else" dynamically?