lundi 15 décembre 2014

Take the value of another column if the query column is between two column values


So i have a file with column that has information on salary (eg. 2674 dollars) -



indi salary
sam 2674
john 6375
max 9547


and another file with the scale of the salary (column1&colum2) on its corresponding rank (column3)



salary_min salary_max Rank
2000 4000 Deputy
4000 6000 secretary
6000 8000 Assistant
8000 10000 Manager


Now I would like to assign those individuals from file 1 based on the salary to their corresponding rank


so the final output would be



indi Rank
sam Deputy
john Assistant
max Manager


How can I achieve this in linux on the same dataset type but with larger data?



Aucun commentaire:

Enregistrer un commentaire