AIX ksh server hosted by vendor
How to parse & process the other params in the array**?
If it will help, to make the array layout different(?), I'm not married to awk, and in fact for other scripts, similar & less complex (fewer iterations & parameters) the array was arranged & parsed with substring commands w/a simple do/done loop, and before I give up on awk I'm posting here...
please suggest diff array layout it will help(?); note: the name=value (NV) will be actual parameters, however the values are going to be variables some requiring updates by functions, so final NV past to sed to edit a parameter file e.g. name=$value, w/Each line of the array are parameters to be eval about ~16 times with slight variations found in each line of the array...
# first 4 [0-3] params...
arrParams=
set -A arrParms
arrParams[0]='tpName'='ACCESSTC','fq'='Weekly','pID'='000000010','pDt'='Wed','HP'='PHP-GA','Act'='1','fDt'='Wed','IncFt'='1'
arrParams[1]='tpName'='MAGBHHTH','fq'='Weekly','pID'='999083153','pDt'='Mon','HP'='PHP-GA','Act'='1','fDt'='00000000','IncFt'='0'
arrParams[2]='tpName'='AMLOG','fq'='Weekly','pID'='000000014','pDt'='Mon','HP'='PHC-CA','Act'='1','fDt'='00000000','IncFt'='0'
arrParams[3]='tpName'='VSP','fq'='Weekly','pID'='000000023','pDt'='Mon','HP'='PHP-GA','Act'='1','fDt'='00000000','IncFt'='0'
#Show Array
for p in ${arrParams[@]};do
echo $p
done
...then...
# the IFS lines were from prior Unix.com posts so if not needed le'meknow.
# show TP record (partial key) for array at this point a new command would be made using the other NV
oIFS="$IFS"; IFS=','
for p in ${arrParams[@]};do
echo $p | awk -F, '{row=$0;
for(i=1;i<=NF;i++)
{ #row_split_col=$i;
if(substr($i,1,6) == "tpName"){
TPName=substr($i,8,20)
print
}
}
}'
done
IFS="$oIFS"
**Parse & process other params; e.g. pDt=Mon means cycle = Monday to Monday with prior Monday date using... datecalc -- Perderabo's date calculator 2002-03-04 and my own dw2dw function
So, how to catch the other NV pairs and set the $value by calling functions w/in awk?
this link seems close but I'm dull on syntax...
