Re: Copy entire file as one field - Mailing list pgsql-novice

From Oliver Elphick
Subject Re: Copy entire file as one field
Date
Msg-id 1038953001.1419.1.camel@linda.lfix.co.uk
Whole thread Raw
In response to Re: Copy entire file as one field  ("Warren Massengill" <warrenmassengill@hotmail.com>)
List pgsql-novice
On Tue, 2002-12-03 at 19:48, Warren Massengill wrote:
> My database is pg, the table is mail.
> The small text files are in /home/kelly/message/.
> The bash shell script is merge.
>
> Somehow I failed to translate your instructions...
>
> -----------------------------------------------------
> #!/bin/bash
>
> for f in `ls /home/kelly/message*`
                               ^^^^^^
                           message/*

> do
>         psql -d pg -c "INSERT INTO mail (message)
>                                  VALUES ('`cat $f`')"
> done

Your files are in that directory, so the wild card must be too.
--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "What shall we then say to these things? If God be for
      us, who can be against us?"              Romans 8:31


pgsql-novice by date:

Previous
From: "John Sklavounos"
Date:
Subject: Help! Lost functions
Next
From: "Devinder K Rajput"
Date:
Subject: Re: Copy entire file as one field