I have a file with data as below
1020130202PUS
1020130202PUS
1020130202BUS
1020130202PUS
1020130202PUS
1020130202BUS
1020130202PUS
1020130202BUS
I need to add header and trailer which I was able to find on the fourm but in trailer I need multiple count as below
Trailer 0000008 0000003 0000005
where first number is total record count, second is record count with "P" in 11th position and third record count is "B" in 11th Position. Please help me to achieve it