-6

how could I get two files together like this

file1.txt:

ROW 1 3  5 654 56 5 56 65 6 54 4 3345 35 53 3 32 2 1
ROW2  6 65 456 67 687 78 89 657  435 34 534 5 435 5 2

file4.txt:

01010100000000000000000000000000000101010001010
1111111111111111111100100101000101001000000000
01000000000000000000000000000000000000000000000

to:

ROW 1 3  5 654 56 5 56 65 6 54 4 3345 35 53 3 32 2 1
ROW2  6 65 456 67 687 78 89 657  435 34 534 5 435 5 2
01010100000000000000000000000000000101010001010
1111111111111111111100100101000101001000000000
01000000000000000000000000000000000000000000000
1

2 Answers 2

1

Use cat:

cat file1.txt file4.txt
4
  • will there be a newline? Jun 25, 2015 at 14:15
  • 2
    @user3069326 is it this again?
    – muru
    Jun 25, 2015 at 14:18
  • @user3069326 Don't you have newlines at the end of files?
    – heemayl
    Jun 25, 2015 at 14:19
  • @muru Seems so....
    – heemayl
    Jun 25, 2015 at 14:21
0

using cat:

cat file1.txt file4.txt > output.txt

Output:

$ cat output.txt

ROW 1 3  5 654 56 5 56 65 6 54 4 3345 35 53 3 32 2 1
ROW2  6 65 456 67 687 78 89 657  435 34 534 5 435 5 2
01010100000000000000000000000000000101010001010
1111111111111111111100100101000101001000000000
01000000000000000000000000000000000000000000000

If you don't want to create a new file easily:

cat file1.txt >> file4.txt 

Output:

$ cat file4.txt

ROW 1 3  5 654 56 5 56 65 6 54 4 3345 35 53 3 32 2 1
ROW2  6 65 456 67 687 78 89 657  435 34 534 5 435 5 2
01010100000000000000000000000000000101010001010
1111111111111111111100100101000101001000000000
01000000000000000000000000000000000000000000000

Not the answer you're looking for? Browse other questions tagged .