On Thu, 2002-11-28 at 00:40, Warren Massengill wrote:
> How can I copy several hundred small text files into a database, each file
> going into a field called 'message' and becomming one record (with or
> without other fields) using psql?
A bit of shell scripting:
for f in `ls small_file*`
do
psql -d mydatabase -c "INSERT INTO mytable (message)
VALUES ('`cat $f`')"
done
--
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
========================================
"The earth is the LORD'S, and the fullness thereof; the
world, and they that dwell therein." Psalms 24:1