| File Merge | ||||||||||||||||||
| To merge two files is
to combine them into a single file.
Two files can only be merged together if they have the same structure - the fields are defined the same in each file. The new merged file contains all the records of both the merged files. The two files must be sorted in the same way. The resulting merged file will also be sorted in the same way.
|
||||||||||||||||||
Merging files (in words) :
|
||||||||||||||||||
|
|
File 1 and File 2 are
merged together to create a new merged file which contains all records
from File 1 and File 2.
File 1, File 2 and the new file will ...
Files may be saved on media other than magnetic tape. |
|||||||||||||||||
Example : File 1 : |
||||||||||||||||||
File 2: |
The two files to be merged are sorted in order of ID. | |||||||||||||||||
|
||||||||||||||||||
| Merged file : | ||||||||||||||||||
|
The merged file is also sorted in order of ID. | |||||||||||||||||
| Any number of files may be
merged together if they are properly sorted and have the same data
structure.
|
||||||||||||||||||
| Exercise : File Merge | ||||||||||||||||||
| To
two files involves combining
them together into a new file.
The two files to be merged must be and the new file will be sorted in the same order.
|
||||||||||||||||||
| (Green indicates success) | ||||||||||||||||||