[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Import scripts
- Subject: Re: Import scripts
- From: "Chris Travers" <..hidden..>
- Date: Wed, 20 Aug 2008 08:24:38 -0700
On Wed, Aug 20, 2008 at 7:18 AM, Dave Coventry <..hidden..> wrote:
> Hi,
>
> How is the repository of scripts coming on for Ledgersmb?
>
> I have a couple of spreadsheets with sales items, costs and prices. Is
> there a script that I can use to pull these into the Postgres
> database?
Importing data from spreadsheets on a case-by-case basis is pretty
easy (as long as you are comfortable with SQL) with PostgreSQL, as
long as you can save as csv.
There is no script however. What you need to do is:
1) create a temporary table with the same column number as your
spreadsheet. Usually I use text fields for everything because I find
that is easier to deal with.
2) In psql, COPY the table from the file (see \h COPY for help)
3) Use sql queries to move the data in.
If you post the columns you need to import here, I can provide a quick
mapping to the db schema.
Since every spreadsheet is different, every import tends to be different.
Best Wishes,
Chris Travers