This has already been answered here http://www.unix.com/unix-dummies-questions-answers/156998-need-help-searching-file-range.html\#post302509048
---------- Post updated at 03:05 PM ---------- Previous update was at 03:00 PM ----------
awk -F, '{x=0+substr($1,1,5)}(x>1200)&&(x<1230)&&($2~/(A|N)/)&&($3~/^2/)&&($4~/a/)' infile
use nawk if on solaris
# nawk -F, '{x=0+substr($1,1,5)}(x>1200)&&(x<1230)' infile
0120123456,C,200,xcvfe
0120453576,A,201,fgsa
0120432343,A,402,dewa
0122344242,N,204,ghfs
# nawk -F, '{x=0+substr($1,1,5)}(x>1200)&&(x<1230)&&($2~/(A|N)/)' infile
0120453576,A,201,fgsa
0120432343,A,402,dewa
0122344242,N,204,ghfs
# nawk -F, '{x=0+substr($1,1,5)}(x>1200)&&(x<1230)&&($2~/(A|N)/)&&($3~/^2/)' infile
0120453576,A,201,fgsa
0122344242,N,204,ghfs
# nawk -F, '{x=0+substr($1,1,5)}(x>1200)&&(x<1230)&&($2~/(A|N)/)&&($3~/^2/)&&($4~/a/)' infile
0120453576,A,201,fgsa
#