On Wed, Aug 22, 2012 at 5:57 PM, John R Pierce <pierce@xxxxxxxxxxxx> 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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general