Roshnii
New User
Joined: 30 Sep 2008 Posts: 45 Location: bangalore
|
|
|
|
Hi,
I have two input files like like this.
File 1
Code: |
Header-rec
pat maths 25 science 40
mark maths 30 science 50
trailer maths 55 science 90
|
And file 2 like this
Code: |
Header-rec
Trevor maths 15 science 30
Stephen maths 45 science 40
trailer maths 60 science 70
|
I need to merge the two files into one file with only one header and one trilaer record and the trailer record should have the sum of both the first file and the second file. For example, file 1 has trailer record with total marks in maths as (25 + 30) = 55 and file 2 has total marks in maths as (15+45) = 60 . So the merged file has the marks in maths in the trailer record as 115 which is the sum of all marks.
Should I use 'sum' to sum the fileds up?
The file length is 32 (15+5+3+6+3)
Code: |
Header-rec
pat maths 25 science 40
mark maths 30 science 50
Trevor maths 15 science 30
Stephen maths 45 science 40
trailer maths 115 science 160
|
Thanks
Roshnii |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
The file length is 32 (15+5+3+6+3) |
What do those individual lengths represent?
The layout of your input records is not clear. Are the values (e.g. 'pat', 'maths', '25', 'science', '40') in fixed positions or variable positions?
Please describe the layout in detail. Give the starting position, length and format of each relevant field.
Does the header really look like that, or does it look different? If different, what does it look like?
Same question for the trailer.
Is there information in the input header and trailer that has to be kept for output, or can the header and trailer just be rebuilt with the correct information? |
|