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