So the question is:
Display all of the lines in the file showing only the quantity and product name, in that order, using awk. Product name is the first field and quantity is the second field. The data file is "inventory"
The contents to inventory:
Strawberry Jam,300,4
Raspberry Jam,1216,7
Blueberry Jam,96,195
Strawberry Compote,49,621
Raspberry Compote,1937,624
Blueberry Compote,200,625
Frozen Strawberries,130,1941
Straw Hats,16,2047
My command was
awk '$2 $1' inventory
That should work right? I also tried like
awk '{print $2 $1}' inventory
awk '$2, $1' inventory
and a lot of variations of that, but none works! Can anyone help figure out why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…