Created
August 14, 2012 21:44
-
-
Save fike/3353313 to your computer and use it in GitHub Desktop.
Loading multiple files csv in postgresql
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
#!/bin/sh | |
for i in $(ls *.csv) | |
do psql -U postgres -c "COPY carga FROM '/tmp/$i' WITH DELIMITER ',' CSV HEADER" test; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment