Am facing problem while sorting a CSV file
My input file looks like this.Input Lrecl is 80.
id,wages,day
a12345,345,monday,
a12345,345,monday,
a12345,567890,monday,
a12345,345,tuesday,
a12345,34500,monday,
b12345,345,monday,
b12345,34,monday,
I need only those records with least wages in one output file and the records which are rejected in another output file
My output file 1 ( Only Least Wages )
a12345,345,monday
a12345,345,tuesday
b12345,34,monday
MY Output file 2 (Rejected Records)
a12345,34500,monday,
a12345,567890,monday,
b12345,345,monday,
Can anyone suggest me how to do it using sort.
If i sort the entire record and give xsum ,am getting wrong output like this
Output1:
a12345,345,monday,
a12345,567890,monday,
a12345,345,tuesday,
a12345,34500,monday,
b12345,345,monday,
b12345,34,monday,
Output2 :
a12345,345,monday,