[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Change colums and rows.



F Zimmermann wrote:
hello a have a little problem. I scanned a DNA sequence and the OCR
software changed colums and rows. So instead of
aaaaaaaaaa bbbbbbbbbb cccccccccc
aaaaaaaaaa bbbbbbbbbb cccccccccc

I got this

aaaaaaaaaa aaaaaaaaaa
bbbbbbbbbb bbbbbbbbbb
cccccccccc cccccccccc

How can I change them back into the right order?

Really thankfull for any hints,

	Frank


Assuming the wrong format is in a file called columns.txt and we are going to correct it and put it in a file called rows.txt

for i in 1 2 ; do cut -d' ' -f$i columns.txt | tr '\n' ' ' >> rows.txt ; echo >> rows.txt ; done

If your real data has more than 2 columns like your example here, just add the appropriate amount of numbers to the "for i in 1 2" part



Reply to: