counter problem

Hi,

I'm attempting to take the following input list and create an output file as shown below. I've monkeyed around for long enough. Can anyone help?
NOTE: fs*** will be header and I want to get a count on NY**.

fs200a
NY7A
fs200b
NY7B
NY7B
NY7B
fs200c
NY7C
NY7C
NY7C
NY7C
fs201a

Any help would be greatly appreciated.

What I want it to look like:

fs200a fs200b fs200c fs201a
1 3 4 0

Sorry... that's KSH.

Take a look at

http://www.unix.com/shell-programming-scripting/57585-script-help-please.html#post302176934

The script create breaks between sections, and groups together records for each break. You should be able to start with code such as this.