See this simple file
* * * : * * * .
so it have three rows . Those first two rows say
A and A match then it will be * (asterisk) in the third row.
and those D and E not match there will be colon (: ) or
G and H not match .(fullstop) in the third row
Our question is
In third row where there is colon (: ) and .(fullstop)
tell the number and wht is that name at that number
therefore output will be
D4E because colon is at 4 number
G7H because fullstop is at 7 number
And it will be a long file where there is colon and full stop
just tell the number and name ...
One more question is
In some other files colon or fullstop may be at 4th row or 5th row
can u script this one also separately
Are there always only 2 mismatched letters in each pair of rows? Just wondering if you do multiple colons before full stop and how you handle that.
Also, can you post what you have so far? Just curious as to where you're having the issue.
Thanks for looking into the question
Actually u can say this is a part of sequence alignment ( biology) where amino acids of one sequence aligns with amino acids of another sequence Say between human and chimpanzee
so those amino aicid match thatwill give asterisk
otherwise colon or fullstop ( this is by software program which can produce that)
can u produce a script if u look into the question previously posted if possible.
Sorry, I know awk/sed was requested, but a python solution was so easy, couldn't help to post it:
(a, b) = (, )
for line in open("sq.txt"):
if i == 1:
a = list(line)
elif i == 2:
b = list(line)
elif i == 3:
for (x,k) in enumerate(list(line.replace(' ',''))):
if (k in diffchar):
Discard if you can't have Python. This may give you some idea about the awk code though (feel too lazy to translate in awk:)