Since you're using bash, I will assume you are not averse to using a
slightly complicated pipeline. First, install this:
https://github.com/wireservice/csvkit

Then use that to cut out the columns, you want and pipe the result into
psql with an appropriate \copy command.

On Wed, Mar 8, 2017 at 4:13 AM, Günce Kaya <guncekay...@gmail.com> wrote:

> Hi all,
>
> I want to import content of CSV file to a table via bash script without
> creating temporary table and I also want to skip some columns in CSV file
> (for instance, CSV file has 12 column and main table has only 2 column, If
> possible I would use only 2 column in CSV file) Is there any way to do it?
>
> Regards,
>
> --
> Gunce Kaya
>

Reply via email to