littleIdiot
MIS
Ok - I am an AWK novice, and can just about use single line commands to do what I need, but I have now come up against a challenge and I don't have tme to learn AWK to work out how to do it. I'm hoping someone here can help me out.
I have a file that is composed of ~500,000 rows and 3 columns, that looks a bit like this:
MAKE | MODEL | COLOUR
--------------------------
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
BMW | 3-Series | Silver
BMW | 3-Series | Silver
BMW | 3-Series | Silver
BMW | 3-Series | Silver
BMW | 3-Series | Silver
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
BMW | 3-Series | Yellow
BMW | 3-Series | Yellow
BMW | 3-Series | Yellow
BMW | 3-Series | Yellow
Ford | Mondeo | Blue
Ford | Mondeo | Blue
Ford | Mondeo | Blue
Ford | Mondeo | Blue
Ford | Escort | Black
Ford | Escort | Black
Ford | Escort | Silver
Ford | Escort | Silver
Ford | Escort | Silver
Ford | Escort | Silver
Ford | Escort | Black
Ford | Escort | Black
...
Obviously the data here is made up, but hopefully you get the idea.
I want to produce the following:
MAKE | MODEL | COLOUR | Number
Ford | Mondeo | Red | 3
BMW | 3 Series | Silver | 15
...
I know that I have the following unique number of each column:
Make : 518
Model : 92
Colour : 7
Total number of records: 416,098
How can I get the results I require?
All help appreciated.
Thanks.
I have a file that is composed of ~500,000 rows and 3 columns, that looks a bit like this:
MAKE | MODEL | COLOUR
--------------------------
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
BMW | 3-Series | Silver
BMW | 3-Series | Silver
BMW | 3-Series | Silver
BMW | 3-Series | Silver
BMW | 3-Series | Silver
Ford | Mondeo | Red
Ford | Mondeo | Red
Ford | Mondeo | Red
BMW | 3-Series | Yellow
BMW | 3-Series | Yellow
BMW | 3-Series | Yellow
BMW | 3-Series | Yellow
Ford | Mondeo | Blue
Ford | Mondeo | Blue
Ford | Mondeo | Blue
Ford | Mondeo | Blue
Ford | Escort | Black
Ford | Escort | Black
Ford | Escort | Silver
Ford | Escort | Silver
Ford | Escort | Silver
Ford | Escort | Silver
Ford | Escort | Black
Ford | Escort | Black
...
Obviously the data here is made up, but hopefully you get the idea.
I want to produce the following:
MAKE | MODEL | COLOUR | Number
Ford | Mondeo | Red | 3
BMW | 3 Series | Silver | 15
...
I know that I have the following unique number of each column:
Make : 518
Model : 92
Colour : 7
Total number of records: 416,098
How can I get the results I require?
All help appreciated.
Thanks.