Code:
perl -pe 's/(P\d+)\d,/$1,/g' arunkumar.file
P,1
M1,
P19592585,P19592585,P19592585,P19592600,P19592600,P19592600,P19592601,P19592601,
P19592601,P19592601,P19592601,P19592601,P19592601,P19592601,P37162285,P37162286,
P37162286,P19592601,P37162286,P37162286,P37162286,P19592601,P19592602,P19592602,
P19592602,P19592602,P19592602,P19592602,P19592602,P19592602,P19592602,P37162286,
P37162286,P37162286,P19592603,P19592603,P37162286,P37162286,P37162287,P19592603,
P19592603,P19592603,P19592603,P19592603,P19592603,P19592603,P19592603,P19592604,
P19592604,P37162287,P37162287,P19592604,P19592604,P19592604,P19592604,P19592604,
M,1,1,0
M,1,2,0
M1,3,0