unfortuntely, none of the suggested commands work.
i need to be able to specify the column to look into. most columns are counted from left to right. however, due to spaces/tabs or formatting differences in files, one may want to grab a column based on the count of right to left.
The solution i need should be able to take a regular numerical value AND also a value like "(NF-whateverNUmber)" which means, count from right to left.
The full data file looks like this:
costingintegration.ExceptionLogEntry query {"_id": 1, "retryFlag": {"$ne": 1}} 1 3778 3778 3778 n/a 3778
costingintegration.negotiatedProductCosts query {"$and": [{"season": 1}, {"year": 1}]} 9 138 735 410 n/a 3696
costingintegration.negotiatedProductCosts query {"brand": 1, "season": 1, "year": 1} 6 109 2447 534 n/a 3208
costingintegration.$cmd count {"costType": 1, "season": 1, "year": 1} 2 1151 1536 1343 n/a 2687
costingintegration.PrimaryCost query {"season": 1, "year": 1} 2 271 1905 1088 n/a 2176
costingintegration.negotiatedProductCosts getmore {"$and": [{"season": 1}, {"year": 1}]} 11 104 353 148 n/a 1630
masteritem.$cmd findandmodify {"_id": 1} 1 1451 1451 1451 n/a 1451
costingintegration.$cmd count {"season": 1, "year": 1} 1 1012 1012 1012 n/a 1012
costingintegration.PrimaryCost query {"costType": 1, "season": 1, "year": 1} 1 500 500 500 n/a 500
costingintegration.PrimaryCost getmore {"bomCCNumber": 1, "season": 1, "year": 1} 1 252 252 252 n/a 252
planningservice.targets query {"ccId": 1, "inDCDate": {"$ne": 1}, "season": 1, "year": 1} 1 160 160 160 n/a 160
costingintegration.$cmd count {"brand": 1, "season": 1, "year": 1} 1 136 136 136 n/a 136
in other words, based on the log file, sometimes, i may need the value of COLUMN to be "4" meaning grab column $4. Or if the format of the log is unusual, i may need to say, grab the 3rd column from the right. so essentially, i need to be able to specify:
COLUMN=4
or
COLUMN='(NF-3)'