help with numbering a file

Hi,

All I need to do is number a file.

The file looks like this

>
JJJJJJJJJJJJJJJJJJJJJ
>
JKJKJKKKKKKJJJ
>
MMMMYKKKJKKK

what I want to do is number it so that theres a numerical value beside the >.

>1
JJJJJJJJJJJJJJJJJJJJJ
>2
JKJKJKKKKKKJJJ
>3
MMMMYKKKJKKK

There are about 600 so I cannot do it manually.

thanks

try this,

awk '{if(/^>$/){print ">"++i}else{print}}' inputfile

another awk solution..

awk '{print $1 ~/>/?">"++i:$0}' inputfile > outfile