I have 2 files file1.seq and file2.seq.They look like these:file1.seqACGGTGTGATGfile2.seqCGTGATGATGTI want to make one fasta file which would be like:>file1.seqACGGTGTGATG>file2.seqCGTGATGATGTHow can I do that?
Making a fasta file from 2 different files
text processing;files
With a simple for loop:for f in file*.seq; do printf >%s\n $f; cat -- $f; done >newfileThe for loop runs trough all files in the directory matching file*.seq.printf ptints the filename.and cat prints the contents of that file.>newfile redirecty everthing to the new file called newfile.Or with awk:awk 'FNR==1{print >FILENAME}1' file*.seqFNR==1 is the current record number in the fileprint >FILENAME print the filename with a leading >1 in all other cases print the line.