1. Mainly use awk to process two files
Number = 0
If [-F Level _ $ number. 'date + % Y % m % d']; then
Awk-F "|" 'nr = FNR {A [$2] = $10 }/
NR> FNR {if (a [$2] = "") Print $2 "|" $2 ;/
Else {A [$2] = $10-A [$2]; print $2 "|" A [$2] ;}} '/
Level _ $ number. 'date + % Y % m % d-d "-1 day" 'level _ $ number. 'date + % Y % m % d' | sort> today_yesterday _ $ number. TMP
Awk-F "|" 'nr = FNR {A [$2] = $10 }/
NR> FNR {if (a [$2] = "") Print $2 "|" $2 ;/
Else {A [$2] = $10-A [$2]; print $2 "|" A [$2] ;}} '/
Level _ $ number. 'date + % Y % m % d-d "-2 day" 'level _ $ number. 'date + % Y % m % d-d "-1 day" '| sort> yesterday_other _ $ number.
TMP
Comm-23 today_yesterday _ $ number. tmp yesterday_other _ $ number. tmp> 'date + % Y % m % d' _ $ number. tmp
Awk-F "|" 'nr = FNR {A [$1] = $2 }/
NR> FNR {if (a [$2]! = "") Print $0 ;}'/
'Date + % Y % m % d' _ $ number. tmp level _ $ number. 'date + % Y % m % d'> result _ $ number
Rm today_yesterday _ $ number. tmp
Rm yesterday_other _ $ number. tmp
Rm 'date + % Y % m % d' _ $ number. tmp
Fi
//////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// ///////////////