Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding=utf-8
- #########################################################
- # Script para pegar varios arquivos sql em um diretorio
- # e mesclar todos em um unico arquivo.
- # by: Anderson Firmino (coderpy) <anderson.araujoprog@gmail.com>
- # by: Gustavo Rodrigo (hpix) <rodrigogustavo_@hotmail.com>
- #########################################################
- import os
- def procedimento(path):
- final_file = ""
- for fn in os.listdir(path):
- fn = path + fn
- with open(fn, 'r') as f:
- final_file += f.read()
- with open('final.sql', 'w') as f:
- f.write(final_file)
- if __name__ == '__main__':
- directory = os.path.dirname(os.path.abspath(__file__))
- directory += "/directory/"
- procedimento(directory)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement