8

Let's assume that I've got two text file a, b.

$cat a
a a
a a
a a

$cat b
b b
b b
b b

Then, I want to merge these two file vertically by using paste. The merged file is shown bellow

a a
a a
a a
b b
b b
b b

NOT

$paste a b > AB
$cat AB
a a b b
a a b b
a a b b
4
  • "The merged file will be b" should be changed "The merged file will be below". I don't know how to modify. Commented Jan 17, 2017 at 9:57
  • paste -sd '\n' a b Commented Jan 17, 2017 at 9:58
  • 3
    You mean something like cat a.txt b.txt? To edit your question just press edit under your question Commented Jan 17, 2017 at 9:59
  • 1
    cat is short for concatenate. Commented Jan 17, 2017 at 10:05

1 Answer 1

6

Just cat a.txt b.txt > out.txt. If you want even spaces and no blank lines

$ awk 'NF' inputA.txt inputB.txt                           
a a
a a
a a
b b
b b
b b

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.