If I have 2 files where the first lines contain identical headings:
A.txt:
A
1
aa
B.txt
A
ee
7
I want to combine them like so:
C.txt
A
1
aa
ee
7
Is there a one liner to do this?
|
If I have 2 files where the first lines contain identical headings: A.txt:
B.txt
I want to combine them like so: C.txt
Is there a one liner to do this? | |||||
feedback
|
| |||
|
feedback
|
|
If order is not a problem: sort A.txt B.txt | uniq | |||||
feedback
|
|
Here's another way that's easily scalable to any number of input files (just add them as additional arguments:
| |||
|
feedback
|