I have 2 files, one is the master file and the other is a subset of this file, with some additional data. Both the files are in the form of fields with a ^A separator. My job comes in that, from the master file, I wish to create the subset files. The subset files already have some data, which I can duplicate, but I want the fields available in the master file to be also available in the subset file.
Example:
subset file format:
1234^A56^A78^A910^A1112^A13^A14^A151617^A18^A192021.000000^A22.000000
master file format:
1242^A2282^A2^A1^A0
1234^A78^A910^A4^A4
1380^A2594^A2^A25^A3
1404^A2447^A6^A44^A9
In the above example, the master file has 4 rows, while the subset file has 1 row. The values of the 2nd row of the master file match the row in the subset file.
I want to create the additional lines in the master file, into the subset file too. Basically, the first, third and fourth fields in the subset file should match the first 3 fields of the master file, the rest can be any randomly generated values.
Also, I wish to retain the ^A separators in the subset file.