bash - awk prints new column on a new line -


please suggest me how fix annoying issue. use awk make simple calculation , print result on new tab separated column. works, awk prints result on column on new line. please have look

     chr1   839976  840333  44  66151894      chr1   855835  856060  23  66151894      chr1   860112  860337  25  66151894  awk 'begin { ofs = "\t" } { $6 = $3-$2 } 1 ' file1.txt > result1.txt 

this command print this

   chr1 713869 714267 79 66151894    398    chr1 839976 840333 44 66151894    357    chr1 855835 856060 23 66151894    225 

can fix command properly?

when run command works fine me, assumption please check if have carriage characters in input_file doing cat -v input_file use following commands remove them first.

tr -d '\r' < input_file > temp_file && mv temp_file input_file 

then give shot own command.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -