Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 866.1k
  • 205
  • 1.8k
  • 2.3k
Source Link
dovah
  • 1.8k
  • 7
  • 24
  • 41

Merging columns from two separate files

How to create a new file merging selective columns from two separate files using awk? Without messing up the elements orders of BOTH files.

Exemple: File 3 may contain column 1,2,3 from File 1 and column 4 from File 2.

File 1
A   23  8   T
A   63  9   9
B   45  3   J

File 2
A   0
A   6   
B   5

File 3
A   23  8   0
A   63  9   6
B   45  3   5