If awk is your option, would you please try:

awk '
    /^>Code1234_length1/ {f = 1; print; next}   # if the keyword is found, set the flag,
                                                #    print the line and continue with the next line
    f {                                         # if the flag is set
        if (/^>/) f = 0                         #    if next ">" is found, reset the flag
        else print                              #    otherwise print the line
    }
' your.file > new.file

It works even if multiple lines follow the >Code1234_length1 line.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top