awk like sql

1)sample data

tk-no-MacBook-Pro:~ tk$ cat test.csv

01,8888888,9999999999

09,7777777,6666666666

02,2777333,9999992222

03,8888888,6567637476

2)select col2,col3 from ... where col1 = 09

tk-no-MacBook-Pro:~ tk$ awk -F, '{if ($1 == 09) print $2","$3;}' test.csv

7777777,6666666666

tk-no-MacBook-Pro:~ tk$ 

 

3)if you need format 

tk-no-MacBook-Pro:~ tk$ cat test.csv

01,8888888,9999999999

09,7777777,6666666666

02,2777333,9999992222

03,8888888,6567637476

09,667,8987233598

4)

tk-no-MacBook-Pro:~ tk$ awk -F, '{if ($1 == 09) printf "%07d%s%07d\n",$2,",",$3}' test.csv

7777777,6666666666

0000667,8987233598