>perl -p -e "s|(.*?)\.(\w\w\w),|iif([month]>,$1.$2,0) as $2|" temp.txt iif([month]>,[01-estimate].jan,0) as jan iif([month]>,[01-estimate].feb,0) as feb iif([month]>,[01-estimate].mar,0) as mar iif([month]>,[01-estimate].apr,0) as apr >perl -p -e "s/(.*?)\.(\w\w\w),/iif([month]>,$1.$2,0) as $2/" temp.txt iif([month]>,[01-estimate].jan,0) as jan iif([month]>,[01-estimate].feb,0) as feb iif([month]>,[01-estimate].mar,0) as mar iif([month]>,[01-estimate].apr,0) as apr