Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Do all your files have just one sequence or can you have more lines starting with >? Do you always have a space after the >? That isn't standard, or required by the fasta format. More importantly, how many files do you have? Do you even need a loop? If you do, can we just do for f in * and get all the files of interest, or should that be for f in *fa or something else? Can you show us the output of ls in the target directory and tell us what files should be modified? Commented May 24, 2023 at 16:01
  • all files have two rows, it is a fasta file yes. It starts the first line wit the > and the second does not have the >. I would like to modify only the first line. Commented May 24, 2023 at 16:15
  • OK, and how many files? You really don't want to use a variable, so please show us the output of ls in the directory with your files and indicate which ones should be changed. Can we just do for file in *fa; do... to get all files? And where does the ATTTCC come from? Do you want us to add something from the sequence line or the ID line? Can you show us an example file? Commented May 24, 2023 at 16:39
  • I have corrected the post adding file2 is supposed to be ATTTCCfile2 Commented May 25, 2023 at 8:40