jayjaybigs
IS-IT--Management
Hello,
I have a sample flat file as below. Note that it is delimited by |.
-the object is write a little script read the file.
-select the distinct fileds.
-group by 4th abd 5th fields and do the sum on 10th field.
N|3|10|2461|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-.70|0|0| | |N
N|3|10|2461|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |+.70|0|0| | |N
N|3|10|2461|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-.70|0|0| | |N
N|3|10|2462|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-37.80|0|0| | |N
N|3|10|2462|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |+37.50|0|0| | |N
N|3|10|2462|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-37.50|0|0| | |N
N|3|10|2462|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |+37.50|0|0| | |N
Hence, I want the result to look like the following:
N|3|10|2461|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-00.70|0|0| | |N
N|3|10|2462|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-00.30|0|0| | |N
Has anyone being able to the this before.
Please help.
I have a sample flat file as below. Note that it is delimited by |.
-the object is write a little script read the file.
-select the distinct fileds.
-group by 4th abd 5th fields and do the sum on 10th field.
N|3|10|2461|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-.70|0|0| | |N
N|3|10|2461|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |+.70|0|0| | |N
N|3|10|2461|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-.70|0|0| | |N
N|3|10|2462|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-37.80|0|0| | |N
N|3|10|2462|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |+37.50|0|0| | |N
N|3|10|2462|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-37.50|0|0| | |N
N|3|10|2462|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |+37.50|0|0| | |N
Hence, I want the result to look like the following:
N|3|10|2461|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-00.70|0|0| | |N
N|3|10|2462|0003|25092004|P2K PAYROLL SUMMARY|PAYROLL 24092004| |-00.30|0|0| | |N
Has anyone being able to the this before.
Please help.