0

I actually have to cat all files into a directory but with python. In bash command it would be:

cat ./* > newfile

I guess it should be something like that:

with open(new_directory_0035+"/merged.txt", 'w') as f:
    for line in fileinput.input(glob.glob(new_directory_0035+"/*")):
        f.write(line)
    fileinput.close()

but it is still running after 20 minutes, do you know if I wrote something wrong? And it seems to take to much memory as well... Thanks

Grendel
  • 555
  • 1
  • 4
  • 11
  • Have you tried any of [these](https://stackoverflow.com/questions/2512386/how-to-merge-200-csv-files-in-python) | [other](https://stackoverflow.com/questions/44791212/concatenating-multiple-csv-files-into-a-single-csv-with-the-same-header-python) | [solutions](https://stackoverflow.com/questions/30335474/merging-multiple-csv-files-without-headers-being-repeated-using-python)? – jpp May 19 '18 at 12:55
  • Hi, well these exemples are for dataframe, but me if for fasta files to creat one unique multiple fasta file not merge several dataframe in csv format – Grendel May 19 '18 at 15:11

0 Answers0