Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Perl and Pipes. Share your story.

by EvanCarroll (Chaplain)
on Apr 12, 2006 at 21:38 UTC ( [id://542947]=note: print w/replies, xml ) Need Help??


in reply to Perl and Pipes. Share your story.

Loaded up pgsql with a pipe just today. Perl csv-preprocessor!
./col_proc.pl ./Models.txt 1,5..8 | psql -d vin -c '\copy chrome.model + (id,fkey_subdivision,name,date_effective,comment) FROM STDIN CSV QUO +TE AS '~''

./col_proc delivers the functionality of filtering certain columns out of a csv, because postgres lacks that functionality nativaly any utilized columns must be located at the end of the csv.
Ie if your csv has (foo,bar,baz) and your sql table has (bar,baz) you can't selectivly take it from the csv. So I made ./col_proc.pl to only take columns asked for explicitly.


Evan Carroll
www.EvanCarroll.com

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://542947]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-03-28 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found