Salve F Zimmermann, > 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?
tmp$ cat dna.txt aaaaaaaaaa aaaaaaaaaa bbbbbbbbbb bbbbbbbbbb cccccccccc cccccccccc endtag tmp$ ./reformat.sh aaaaaaaaaa bbbbbbbbbb cccccccccc aaaaaaaaaa bbbbbbbbbb cccccccccc tmp$ cat reformat.sh #!/bin/sh FILE=dna.txt cat $FILE | while read LINE ; do read FIRST SECOND <<EOL $LINE EOL if [ "$FIRST" = "endtag" ] ; then echo "$LINE1" echo "$LINE2" else LINE1="$LINE1 $FIRST" LINE2="$LINE2 $SECOND" fi done It's really important the "endtag" at the end. Good luck. -- Paolo Pedaletti, Como, ITALYa www.fastflow.it/~paolop [EMAIL PROTECTED]