Created
April 1, 2014 03:20
-
-
Save anonymous/9907088 to your computer and use it in GitHub Desktop.
Pasted from IPython
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
filenames = os.listdir('./_User_sharded/') | |
filenames | |
cmd = ['mongoimport','--db','takezero_raw','--collection','users','--file',filename] | |
f = open('mongo_upload','wb') | |
f.write('#!/bin/bash\n') | |
f.write('cd ./_User_sharded/\n') | |
for filename in filenames: | |
cmd = ['mongoimport','--db','takezero_raw','--collection','users','--file',filename] | |
f.write(' '.join(cmd)) | |
f.close() | |
f = open('mongo_upload','wb') | |
f.write('#!/bin/bash\n') | |
f.write('cd ./_User_sharded/\n') | |
for filename in filenames: | |
cmd = ['mongoimport','--db','takezero_raw','--collection','users','--file',filename] | |
f.write(' '.join(cmd) + "\n") | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment