I think your regex is not detailed enough, nor the sed command complete enough, in post #3, to do what you expect it to. Meanwhile, here's an example using grep:
Code:
sasha@reactor: cat asterisk.sh
R.GPLPAAPPAAPERQPS*WER.S
R.GQS*PVSRET*APPVPAARAR.T
R.GQS*PVS*RETAPPVPAARAR.T
R.GQSPVS*RET*APPVPAARAR.T
K.GIPFAT*AKT*LENPQR.H
K.GLHVRAAS*VS*AKGM#SR.K
sasha@reactor: grep -e '\*.*\*' asterisk.sh
R.GQS*PVSRET*APPVPAARAR.T
R.GQS*PVS*RETAPPVPAARAR.T
R.GQSPVS*RET*APPVPAARAR.T
K.GIPFAT*AKT*LENPQR.H
K.GLHVRAAS*VS*AKGM#SR.K
sasha@reactor:
Breakdown the regex: '
\*.*\*'
The stuff inside the '' means to match: a
literal * character followed by
any character(s) followed by another
literal * character. So broken into its parts, the regex means:
\* = a single * character (the * is escaped)
.* = any character(s)
\* = and again, another * character (again, escaped with the back-slash).
If you want the output to go to a new file, redirect it with a > character into a file.