The kosher way to do this is to use your shell. The whole
pgScript seems like too much functionality in pgAdmin. pgScript seems to have been yanked in pgAdmin IV too, so buyer beware.
for i in $(seq 1 100);
do psql -d database -e 'COPY ...';
If you're on windows you can either
That said, I agree with @joanolo. It's comically bad to put your CSVs in your data directory. Under normal circumstances, the CSV's never go to the server. They stay on the client. And then you can just use PSQL's
\COPY. That said, sometimes the locked-down FTP server is the SQL server and it just makes sense, but generally you should be using
COPY, and doing this kind of looping in the shell.
PostgreSQL 9.2 added
DO which seems to provide for scripting on the server. If you really wanted to write a script. I'm sure with it you can write something up that runs natively on your server. See the function for
pg_ls_dir to loop over a dir.