Tuesday, October 26, 2010

Merge many text files to one

import glob

search_pattern = '*.vcf'
dest_file = '__.txt'

with open(dest_file, 'w') as F:
    for infile in glob.glob(search_pattern):
        with open(infile) as f:
            F.write(f.read())
            F.write("\n\n")

print 'All done'
raw_input('Press enter...')

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.