I am working with .gff3 files trying to remove contig sequences in the bottom of many files in a directory. The contig sequences are separated from the rest of the file with a ##FASTA, and I wish to delete everything below (DNA sequences, FASTA format).
This script works for one file:
sed '/^##FASTA$/,$d' file1.gff > file1_altered.gff
But I fail when I try to apply it to all files in a directory like this:
for F in directory/input/*; do
N=$(basename $F) sed '/^##FASTA$/,$d' ${F} > directory/output/$N.gff
done
Any help appreciated!