jfern
1
Hey,
I have a 4 column file
chr10 102827739 102827754 0.47619
chr10 102899308 102899323 2.76087
chr10 102977200 102977215 0.384615
chr10 102985228 102985243 2.4697
chr10 103051370 103051385 1.74359
And want to add a specific value to all entries in columns 2 and 3. Example: add 10, so that line one would become:
chr10 102827749 102827764 0.47619
and so on.
Thanks and sorry, I'm a total newby.
Cheers
Is this a homework assignment?
jfern
3
Nope, I'm a biologist and am trying to change the chromosome sites for analysis.
I was about to delete the post but couldn't figure out how -.-
awk ' { $2=$2+10; print }
worked for me.
Please use CODE tags when posting sample input, output, and code segments.
You said you wanted to add 10 to the values in column 2 AND column 3.
Try:
awk '{$2 += 10; $3 += 10;print}' file