Hello,
I have a csv file with a header.
Example of file content:
Product,Color,Qty
Paper,White,5
Ruler,Yellow,3
Eraser,Blue,9
Ruler,Red,5
Pen,Blue,9
Ruler,Blue,9
Desired new file:
1) Header remains at the top
2) First sort by 1st column (by Product), then sort column 3 (by Qty) in descending order. Example output below:
Product,Color,Qty
Eraser,Blue,9
Paper,White,5
Pen,Blue,9
Ruler,Yellow,3
Ruler,Red,5
Ruler,Blue,9
If possible, i would like to use shell or perl. How can I do this?
I have a csv file with a header.
Example of file content:
Product,Color,Qty
Paper,White,5
Ruler,Yellow,3
Eraser,Blue,9
Ruler,Red,5
Pen,Blue,9
Ruler,Blue,9
Desired new file:
1) Header remains at the top
2) First sort by 1st column (by Product), then sort column 3 (by Qty) in descending order. Example output below:
Product,Color,Qty
Eraser,Blue,9
Paper,White,5
Pen,Blue,9
Ruler,Yellow,3
Ruler,Red,5
Ruler,Blue,9
If possible, i would like to use shell or perl. How can I do this?