I have two files which has following contents
File1
Line1file1
Line2file1
line3file1
line4file1
File2
Line1file2
Line2file2
line3file2
line4file2
I want to have these file's content merged to file3 as
File3
Line1file1
Line1file2
Line2file1
Line2file2
line3file1
line3file2
line4file1
line4file2
How do I merge the files consecutively from one file and another file in bash?
Thanks
You can always use paste
command.
paste -d"\n" File1 File2 > File3
$ cat file1
Line1file1
Line2file1
line3file1
line4file1
$ cat file2
Line1file2
Line2file2
line3file2
line4file2
$ paste -d '\n' file1 file2 > file3
$ cat file3
Line1file1
Line1file2
Line2file1
Line2file2
line3file1
line3file2
line4file1
line4file2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With