So in first row i have 11 pipes which is fine.
In second row I have 4 pipes, so additional 7 pipes should get append
In third row I have 2 pipes, so additional 9 pipes should get append
AIX doesn't use ^M - that's (probably) because the file has come over from Windows and you have CRLF line terminators.
Unless you actually need the carriage returns then you should probably take them out (tr, sed, dos2unix, or whatever), or it's a source of possible problems whenever you're processing the file.