Help for this page

Select Code to Download


  1. or download this
    open(DATA_FILE,"<:utf8",$filename) || die print "can not open reading 
    +file --> \"$filename\"";
    open DB, '| /opt/postgresql-9.4/bin/psql -h ... (here all the paramete
    +rs)'
    print DB "copy $table($header) from STDIN CSV;\n";
    while ( my $line = <DATA_FILE>) {
       print DB "$line";
    }