In article <
568571E7...@scorecrow.com>,
>Here is a variation on Kenny's which avoids that nesting...
>
>BEGIN { RS=">";FS="\n";OFS="" }
> {
> print "> " $1
> $1 = ""
> gsub(/.{25}/, "&\n")
> print
> }
Your output isn't quite correct, although it is unlikely to matter much in
practice. One of the differences is probably just a typo in your source
code (the space after the ">"); the other is likely caused by the
uncertainly that occurs in AWK when the input line ($0) is reconstructed.
I try to avoid solutions that depend on input-line-reconstruction for this
reason. It seems to be an area rife with dark corners.
Anyway, here's a diff between the output of my version and yours:
1c1,3
< >Sequence_1
---
> >
>
> > Sequence_1
7c9
< >Sequence_2
---
> > Sequence_2
P.S. Actually, now that I think about it some more, I think that the
reason for the extra lines in your output is simply because you forgot the
"NR > 1" condition/qualifier.
--
"If God wanted us to believe in him, he'd exist."
(Linda Smith on "10 Funniest Londoners", TimeOut, 23rd June, 2005.)