"Khushboo Soni" wrote:
> I think I have a slight error in my code. I'm trying to sort the second column after
> selecting the required Fuel station and type of Fuel. But it isn't working. Not sure
> what am I missing as I did the same thing in lab computer and it worked.
When describing (future) questions, it'd be great if you can describe your error in a bit of
detail. All we have is "But it isn't working", and knowing what you're seeing or not seeing
> cut -d, -f1,2,4,5 FuelWatchRetail-02-2020.csv| grep "Caltex StarMart Applecross"|
> grep "PULP"|cut -d, -f1,4|sort -t -k2
I think the problem is with your invocation of sort.
When using cut, we must indicate the character used to delimit fields. We cut cut -d, .....
The same is true with sort, though it requires the -t switch, as in:
.... | sort -t, -k
Does that fix it?