Artificial intelligent assistant

How to add new lines from another file with sed I'm trying to find the `sed` command so that I can put `filename` into `filename1`. These are my two separate files. INPUT `filename` has: Cindy 11 22 54 Chester 48 12 84 INPUT `filename1` has: Name Class1 Class2 Class3 Lee 92 94 88 Chancy 91 85 95 Dora 99 77 96 Jefferry 84 98 90 This is the result that I need (output): Name Class1 Class2 Class3 Lee 92 94 88 Chancy 91 85 95 Dora 99 77 96 Cindy 11 22 54 Chester 48 12 84 Jefferry 84 98 90 If I need to clarify anything let me know. Basically Cindy and Chester has to be right in between Dora and Jefferry.

To add all lines from `filename` to `filename1` using `sed` command you can do the following:


sed r filename1 filename


Please note however that the result will be slightly different from the output in your question, namely:


Name Class1 Class2 Class3
Lee 92 94 88
Chancy 91 85 95
Dora 99 77 96
Jefferry 84 98 90
Cindy 11 22 54
Chester 48 12 84


* * *

**Edit**

Some additional `sed` information useful for this question:

* To add `filename` after 4th line of `filename1`:

`sed '4 r filename' filename1`

* To add `filename` after line which starts from "Dora" in `filename1`:

`sed '/^Dora/ r filename' filename1`

* To add `filename` after 4th line and remove any blank lines from `filename1`:

`sed '/^$/d;4 r filename' filename1`

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 1f0bcab4d3a31a92384e2e3eb80ac20d