Donnerstag, 12. Dezember 2013

Bash combining files

Combine files side by side columnwise:

If you have two files one of them consisting of one column and another file consisting of one column as well you can join the files by using:
paste file1 file2

Combine files one after the other:

Simply use:
cat file1 file2
which will first print file1 and then file2.

The "join" command:

Additionally there is also the join command which will print data which is present in file1 and file2, e.g.:
join file1 file2
If file1 and file2 share the same string in one line it gets printed to standard out.

Keine Kommentare:

Kommentar veröffentlichen