Hello

I was looking through my created fasta files and realized that the number of bases are consistently 6 above the number that it should be according to the coordinates. I am not a strong scripter so how would I remove the last 6 bases from every sequence in my fasta file? Note: each line in the sequence is on a new line so I can't just remove 6 from the end of every other, I would need to iterate through it as a fasta file format. 

    >gene1
    CACTGATTTGAGTTTTTTTCATAAATCAGAAACCGTTTGAATTATAAAAA
    AAAAAACCTCACACAGCTCAAACTCAACCTCTGAAAAATAACCCCCAAAG
    TGTAGCACTTCTAGCCCAATTCTTTAAACTTTGGTTGAAGGCTTCTGCAT
    AGAGACGCGGGAAAGACAGTTTTACTGTTTAGCACTCTATGGAGCAACAT
    CTGTAGCAACACTACTGGGGGGCCAGCGCGAGTATATGGACACAAAACAT
    CATGTAGTGTAGGATTTCTGAATAGCAATACACCCTTTGTGGTGATGTAA
    CAATAAAGGAAAGGGCATATTTTTGATGATCATGAGGTGTAGCCCCT

I would like to remove "GCCCCT" from the end. This is a multifasta file so there are hundreds of similar cases within the same fasta file. Thank you!
If you have the gene name, and they match the header in the fasta file, it is still fairly trivial to use python or biopython to trim your sequences. 

1. Linearize your fasta file from multi-line to single line. Pierre's awk statement is the easiest option in the link posted in my comment above. This will make it easier to work with. 
2. Make a file, tab-delimited with the gene name, start coordinate, and end coordinate
3. Save the code below as `trim_fasta.py`, and run as `trim_fasta.py coords.txt input.fasta output.fasta`  

See code below:
  
    #!/usr/bin/env python
    import sys
        
        with open(sys.argv[1], 'r') as f:
            coords = {}
            for line in f:
                coords[line.strip().split('\t')[0]] = (int(line.strip().split('\t')[1]), int(line.strip().split('\t')[2]))
        
        with open(sys.argv[2], 'r') as fasta: 
            with open(sys.argv[3], 'w') as out:
                for line in fasta:
                    if line.startswith('>'):
                        header = line.strip().split('>')[1]
                        out.write('>' + header + '\n' + next(fasta).strip()[coords[header][0]:coords[header[1]])
                