This is a test version of Biostars. For the public version, visit https://www.biostars.org.
input multiple files and write to different files

Hello I wrote this script:

T= open("table")
out_T = open("table-1.out", "w")

table = []

for line in T:
    table.append(line.split())

print T

exp5 = ['qseqid', 'qlen', 'sseqid', 'slen', 'ipdent', 'length', 'length/qlen',]
table.insert(0, exp5)

for elem in table:
    out_T.write('\t'.join(elem) + '\n')

out_T.close()

However I need to apply it to lots of files in the one folder and write each to a new file. Does anyone have a script I can add in to do this?

python

Hello kxd419!

We believe that this post does not fit the main topic of this site.

This is a computer science question, please ask on StackOverflow.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.