welcome to the community, @srivenumuthyalapati.
Please do format your postings (data/code samples) using markdown code tags described here. I've edited your initial post for now - please do so going forward.
As far as your data samples and the desired output goes... I cannot correlate your sample input with your desired output. Take the output case of 123|Chennai|IBM|782.0|2,4
. How did you arrive at 2,4
? These are supposed to be the column numbers containing "different value". Why is it 2,4
?
Can you walk us through your "diff" algorithm, please.
Also... anything you have tried on your own and got stuck somehow?