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?
awk -F"|" '
# File1 : store lines in c[ ] indexed by $1
NR==FNR { c[$1]=$0; next }
{
# Split the corresponding stored line to d[ ]
split(c[$1], d, FS)
# For loop to find and collect deviating fields
out=sep=""
for (i=1; i<=NF; i++)
if ($i"" != d[i]"") { out=(out sep i); sep="," }
# Appended "" casts to a string so a 4.0 differs from a 4
}
# Print the line plus the collected string
out!="" { print ($0 FS out) }
' Left.dat Right.dat