I am having multiple CSV files. Those CSV files are the log files created as a result of running a windows batch file. The location of these CSV files lies on the server and i want all these CSV files to copy from the server to a particular table (say import_error_table, which i had already created in postgreSQL).How to accomplish this using postgreSQL? I tried running a windows batch file which is shown below.
And in the above snapshot, there is exe file to convert shape file to pgsql. I would like to know is there any specific exe for converting CSV to pgsql.
I had run the above code as a batch file. The prep.sql file is created with (0KB size). But also schema was not created in the postgreSQL.
for %%f in (*.csv) do \\192.158.5.170\working\PostGIS\psql.exe -p -k -s 32643 %%f CSV_Logs.%%~nf > prep_%%~nf.sql
set PGPASSWORD=rpc123
for %%f in (prep_*.sql) do \\192.158.5.170\working\PostGIS\psql -h 192.158.5.170 -p 5432 -d NPCL_test -U postgres -f %%f
The result of which is prep.sql files created but schema was not created in postgreSQL.
Aucun commentaire:
Enregistrer un commentaire