Thursday, April 17, 2014

How to change spaces to tabs in a text file

I tried to use bedtools closest to get the nearest genes to the peaks from one chipseq experiment. Bedtools required tab-delimited bed file.

So, how to change spaces from a text file into tabs.
Use tr, type in terminal

tr ' ' '\t' <inputfile >outputfile

No comments:

Post a Comment