Re: What text format is this and can I import it into Postgres? - Mailing list pgsql-general

From Mike Christensen
Subject Re: What text format is this and can I import it into Postgres?
Date
Msg-id CABs1bs24mGTfRy5PFNGGfm-imYcSC74TjZ67dnCKEF5rKV6EVQ@mail.gmail.com
Whole thread Raw
In response to Re: What text format is this and can I import it into Postgres?  (John R Pierce <pierce@hogranch.com>)
Responses Re: What text format is this and can I import it into Postgres?  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
On Wed, Aug 22, 2012 at 5:57 PM, John R Pierce <pierce@hogranch.com> wrote:
> On 08/22/12 5:23 PM, Mike Christensen wrote:
>>
>> I'd like to import this data into a Postgres database:
>>
>>
>> http://www.ars.usda.gov/SP2UserFiles/Place/12354500/Data/SR24/dnload/sr24.zip
>>
>> However, I'm not quite sure what format this is.  It's definitely not
>> CSV.  Here's an example of a few rows:
>>
>
> this worked for me... (in psql)
>
> create table test (f1 text,f2 text,f3 text,f4 text,f5 text,f6 text,f7
> text,f8 text,f9 text);
>  \copy test from DATA_SRC.txt with delimiter '^' csv quote as '~'
> select * from test;
> -[ RECORD 1
>
]-----------------------------------------------------------------------------------------------------------------------
> ----------------------------------------------------------
> f1 | D1066
> f2 | G.V. Mann
> f3 | The Health and Nutritional status of Alaskan Eskimos.
> f4 | 1962
> f5 | American Journal of Clinical Nutrition
> f6 | 11
> f7 |
> f8 | 31
> f9 | 76
> -[ RECORD 2
>
]-----------------------------------------------------------------------------------------------------------------------
> ----------------------------------------------------------
> f1 | D1073
> f2 | J.P. McBride, R.A. Maclead
> f3 | Sodium and potassium in fish from the Canadian Pacific coast.
> f4 | 1956
> f5 | Journal of the American Dietetic Association
> f6 | 32
> f7 |
> f8 | 636
> f9 | 638
> -[ RECORD 3
>
]-----------------------------------------------------------------------------------------------------------------------
> ----------------------------------------------------------
> f1 | D1107
> f2 | M.E. Stansby
> f3 | Chemical Characteristics of fish caught in the northwest Pacific
> Oceans.
> f4 | 1976
> f5 | Marine Fish Rev.
> f6 | 38
> f7 | 9
> f8 | 1
> f9 | 11
> .........
>
>
>
> obviously, use better field  names...

SWEET!

This is exactly what I needed.  Thanks so much..  Already got the
first table imported..

Mike


pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Can column name aliases be supported?
Next
From: Michael Sacket
Date:
Subject: Re: NULL value comparison