I am trying to print out my file in tab delimited formatted along with a new line after end of each line. However I am missing out on the combination I need to put for printing out this format.
Following is my input file: ( this is a space delimited file)
NA18558 NA18609 NA18537 NA18632 NA18564 NA18582 NA18561 NA18611 NA18540 NA18633 NA18566 NA18592 NA18562 NA18612 NA18542NA18635 NA18570 NA18593 NA18563 NA18620 NA18545 NA18636 NA18571 NA18594 NA18572 NA18621 NA18547 NA18637 NA18573 NA18603NA18526 NA18622 NA18550 NA18576 NA18524 NA18605 NA18529 NA18623 NA18552 NA18577 NA18608 NA18532 NA18624 NA18555 NA18579
rs4880608 2 2 2 2 2 2 2 2 2 2 2 2 2 22 2 2 2 NA 2 2 2 2 2 2 2 2 2 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 2
I am planning to print it out as tab delimited file.
Here is my shell script.
#!/bin/sh
awk '{ for (x=1; x<=46; x++) { printf "%s\t", $x } }' CHB_NS_SNP.NEW.txt
I am print columns 1 -45 ie. the entire width of the file and want to add a \n in the shell scipt. Only I am not sure how to do it.
Thanks for your help.