I have the following code copied from github gtfs_SQL_importer:
cat gtfs_tables.sql \
  <(python import_gtfs_to_sql.py path/to/gtfs/data/directory) \
  gtfs_tables_makeindexes.sql \
  vacuumer.sql \
  | psql mydbname
I tried to run this on windows and replaced the call to the UNIX-command cat by the windows equivalent type which should work similar as of is-there-replacement-for-cat-on-windows.
However when I execute that code I get some error:
The syntax for the filename, directory or filesystem is wrong.
So I tried to limit the number of piped files to only combine the call to python and the call to psql:
type <(C:/python27/python path/to/py-script.py path/to/file-argument) | psql -U myUser -d myDatabase
which results in the same error.
However when I execute the python-script alone it works as expected:
C:/python27/python path/to/py-script.py path/to/file-argument
So I assume the error results from using type in order to pipe the result of the script directly to psql.
Does anyone know the correct syntax?
EDIT: To ensure the problem is not related to a file not being found I used absolute paths for all arguments within my command except the type and the psql-command (which are both handled via the %PATH%-variable).
Install cygwin and use unix cat on Windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With