Converting odd values to even values(or vice-versa) located in a column

view story

http://www.unix.com – Hello All, I have a below data in a .csv file where all rows where col1 is A, col2 is odd numbers, similarly even numbers for all rows where col1 is B. Note that my data has some other columns(not shown here) too (around 100) after col2. Code: Tool,Data A,1 A,3 A,5 .... so on B,2 B,4 .... so on I want to convert all odd numbers to even numbers( adding 1).. So my output is like below. Code: Tool,Data A,2 A,4 A,6 ..... so on B,2 B,4 .... so on I need a one liner code for this without splitting the file into 2 portions and joining them later. I tried tried like Code: awk -F, (HowTos)