File_source.DAT
1|abc|abc|abc|abc|abc
2|abc|abc|efg|efg|def
3|abc|bcd|cde|def|efg
4|abc|abc|abc|def|efg
Please help me to solve this as below using UNIX.
File_output.DAT
"1"|"abc" - as abc is the most occured in this line
"2"|"NOT DETERMINED"- abc and efg both repeted twice
"3"|"NOT DETERMINED"- as all are distinct
4|abc - as abc is the most occured in this line