Hi:
I have a file and want to sort it based on 4 fields. The file is to be sorted by field 1. While sorting on field 1, sort field 2 and while sorting on field 2, sort field 3 and so on. I am hoping I am explaining this right!!
Here is an example:
(The file is fixed length but for explanation is "|" delimited.)
Original File -
085460|000082506656|0298|0026
085460|000082506656|0298|0002
085460|000082506643|0298|0012
085460|000082506643|0298|0014
085459|000022000969|0364|0397
085459|000022000969|0364|0400
085459|000022000945|0364|0401
085459|000022000945|0364|0402
085469|000022001418|0362|0009
085469|000022001454|0362|0003
085469|000022001454|0362|0006
085469|000022001418|0362|0010
Sorted File -
085459|000022000945|0364|0401
085459|000022000945|0364|0402
085459|000022000969|0364|0397
085459|000022000969|0364|0400
085460|000082506643|0298|0012
085460|000082506643|0298|0014
085460|000082506656|0298|0002
085460|000082506656|0298|0026
085469|000022001418|0362|0009
085469|000022001418|0362|0010
085469|000022001454|0362|0003
085469|000022001454|0362|0006
I've looked through the threads for sorting but just can't piece what I've read and what I want to accomplish together.
Any help is greatly appreciated.
Thanks.
I have a file and want to sort it based on 4 fields. The file is to be sorted by field 1. While sorting on field 1, sort field 2 and while sorting on field 2, sort field 3 and so on. I am hoping I am explaining this right!!
Here is an example:
(The file is fixed length but for explanation is "|" delimited.)
Original File -
085460|000082506656|0298|0026
085460|000082506656|0298|0002
085460|000082506643|0298|0012
085460|000082506643|0298|0014
085459|000022000969|0364|0397
085459|000022000969|0364|0400
085459|000022000945|0364|0401
085459|000022000945|0364|0402
085469|000022001418|0362|0009
085469|000022001454|0362|0003
085469|000022001454|0362|0006
085469|000022001418|0362|0010
Sorted File -
085459|000022000945|0364|0401
085459|000022000945|0364|0402
085459|000022000969|0364|0397
085459|000022000969|0364|0400
085460|000082506643|0298|0012
085460|000082506643|0298|0014
085460|000082506656|0298|0002
085460|000082506656|0298|0026
085469|000022001418|0362|0009
085469|000022001418|0362|0010
085469|000022001454|0362|0003
085469|000022001454|0362|0006
I've looked through the threads for sorting but just can't piece what I've read and what I want to accomplish together.
Any help is greatly appreciated.
Thanks.