Given a comma-delimited file like this example:
"92528","1","36","38280","51801","PLANT 5 - LINE 1","37",
"92528","1","8","37450","51801","PLANT 5 - LINE 1","37",
"92528","2","8","37896","51801","PLANT 5 - LINE 1","37",
"92528","3","8","37450","51801","PLANT 5 - LINE 1","37",
"92528","61","32","37450","51802","PLANT 5 - LINE 2","37",
"92528","62","16","38721","51802","PLANT 5 - LINE 2","37",
"92528","63","8","38722","51802","PLANT 5 - LINE 2","37",
"92528","64","4","37450","51802","PLANT 5 - LINE 2","37",
"92528","149","8","37450","51804","PLANT 5 - LINE 4","37",
"92528","150","2","38668","51804","PLANT 5 - LINE 4","37",
"92528","151","8","37450","51804","PLANT 5 - LINE 4","37",
"92528","152","2","38668","51804","PLANT 5 - LINE 4","37",
I need to sort it first by the 6th field of each line ("PLANT 5 - LINE 1" on the first line),
then by the 4th field of each line ("38280" on the first line); then I need to get a subtotal for each item in the 4th field so that I only end up with 1 line per item within each plant.
I need to end up with this:
"PLANT 5 - LINE 1","37450","16"
"PLANT 5 - LINE 1","37896","8"
"PLANT 5 - LINE 1","38280","36"
"PLANT 5 - LINE 2","37450","36"
"PLANT 5 - LINE 2","38721","16"
"PLANT 5 - LINE 2","38722","8"
"PLANT 5 - LINE 4","38668","4"
"PLANT 5 - LINE 4","37450","16"
Not sure where to start on this, can someone offer suggestions?