This question already has an answer here:
- To compare column1 of two files 1 answer
I have two files, say file1 and file2.
file1: 91 | 2018-10-11 16:07:14 | bkwdv | 188.0000 | 77 | 2018-10-12 15:05:15 | wvwef | 94.0000 | file2: 77 | 2018-10-12 15:05:15 | wvwef | 94.0000 91 | 2018-10-11 16:07:14 | bkwdv | 188.0000
I would like to compare the first column of file1 with the first column of file2.
In case the strings match (irrespective of the order, as in the given input data), it should print "success", else "exit". So, as per the given input data, it should print "success".
Please note that the number of rows in the first column could vary in either of the files, so in this case, it should exit.