0 - 1 of 1 tags for file export

Hi 
Can anyone please give me some thoughts  on this
I have a scenario where I need to create multiple extract files based on a column values using bteq script and in unx environment.
example 

 table abc 

 

C_Name   ID

xxxxx        1

yyyy          1

aaaaa       2

bbbbb       2