Breaking one file into many files based on first column?

Hi,

I have a file that looks like this (tab deliminited).

MAT1  YKR2  3
MAT1  YMR1  2
MAT1  YFG2  2
MAT2  YLM4  4
MAT2  YHL2  1
BAR1  YKR2  3
BAR1  YFR1  4
BAR1  YMR1  1

What I want to do is break this file down into multiple files. So the result will look like this:

File 1
MAT1

YKR2  3
YMR1  2
YFG2  2

File 2
MAT2

YLM4  4
YHL2  1

File 3
BAR1

YKR2  3
YFR1  4
YMR1  1

Basically the filename will be based on column 1.

thanks

Try:

awk '{ print $2" "$3 >>$1 }' file

> is enough.

awk '{ print $2,$3 > $1 }' file