Commit | Line | Data |
---|---|---|
fd15fd37 BJ |
1 | |
2 | So far you have always dealt with one file at a time. | |
3 | Suppose you wanted to combine two files - there is nothing | |
4 | we have covered so far that will do that. But the | |
5 | editor does have a command 'r' (read) | |
6 | ||
7 | r file | |
8 | ||
9 | which reads in the contents of "file" without throwing | |
10 | away what you already have. So that you can combine | |
11 | the files "cat" and "dog" (and name the result "animal") | |
12 | by saying | |
13 | ||
14 | ed | |
15 | r cat | |
16 | r dog | |
17 | w animal | |
18 | q | |
19 | ||
20 | In this directory are four files named | |
21 | for continents. Combine them into | |
22 | one file named "world". | |
23 | (Read the files in alphabetical order, | |
24 | as they are listed). You may want to list | |
25 | the input files and the combined files | |
26 | with "cat" to see what they look like. | |
27 | When done, type "ready" as usual. | |
28 | #create Ref | |
29 | This is file | |
30 | 'africa' and will be listed first. | |
31 | ------ | |
32 | this file will | |
33 | have to do | |
34 | for both american | |
35 | continents | |
36 | ----- | |
37 | File "asia" | |
38 | is indented | |
39 | two spaces. | |
40 | Europe's file is only one line long. | |
41 | #create africa | |
42 | This is file | |
43 | 'africa' and will be listed first. | |
44 | #create america | |
45 | ------ | |
46 | this file will | |
47 | have to do | |
48 | for both american | |
49 | continents | |
50 | ----- | |
51 | #create asia | |
52 | File "asia" | |
53 | is indented | |
54 | two spaces. | |
55 | #create europe | |
56 | Europe's file is only one line long. | |
57 | #user | |
58 | #cmp Ref world | |
59 | #log | |
60 | #next | |
61 | 60.1b 10 |