Bash script to execute a python package on all files in a folder -


i trying run python package called metl putty , use in files contained in folder. python package metl , using load data contained in 3 .csv files called upload-a.csv, upload-b.csv , upload-c.csv

everything works when process manually using following commands:

metl -m migration.pickle -t new_migration.pickle -s folder_test/upload-a.csv config3.yml metl -m migration.pickle -t new_migration.pickle -s folder_test/upload-b.csv config3.yml metl -m migration.pickle -t new_migration.pickle -s folder_test/upload-c.csv config3.yml 

all data every file correctly uploaded or updated , pickle files updated accordingly.

but instead of doing manually want make loop files contained in 'folder_test/' folder, tried following bash script:

folder_var=folder_test x in $folder_var metl -m migration.pickle -t new_migration.pickle -s $x config3.yml done 

what happens after pickle files created no data uploaded database.

try this

for x in folder_test/* metl -m migration.pickle -t new_migration.pickle -s "${x}" config3.yml done 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -