I have three files with multiple columns but the I want to find the common first column entries. The desired output is at the end of the post. The data entries in files are displayed below.
First file
"OG0000000"
"OG0000001"
"OG0000003"
"OG0000004"
"OG0000005"
second file
"OG0000000"
"OG0000003"
"OG0000004"
"OG0000005"
"OG0000006"
Third file
"OG0000000"
"OG0000004"
"OG0000005"
"OG0000006"
"OG0000007"
output file
"OG0000000"
"OG0000004"
"OG0000005"
That means there are more columns, not shown in your example?
Yes there are multiple columns but I want to take out the list of the first column in a separate file so that I can grep them from individual files later.
So it's not a problem to lose the other columns now? In that case, something like this: (not tested)
But this assumes your file is tab delimited.