simple COPY FROM issue

Started by Kevin Duffyover 17 years ago2 messagesgeneral
Jump to latest
#1Kevin Duffy
KD@wrinvestments.com

Hello All:

I am attempting to import data from a CSV file.

The command I am using is as follows:

copy imagineoptions from 'C:\\Options20081112.csv' DELIMITERS
',' CSV ;

I get the following:

WARNING: nonstandard use of \\ in a string literal

LINE 1: copy imagineoptions from 'C:\\Options20081112.csv'
DELIM...

^

HINT: Use the escape string syntax for backslashes, e.g., E'\\'.

ERROR: could not open file "C:\Options20081112.csv" for reading: No
such file or directory

SQL state: 58P01

If I run DIR at the command prompt I get:

C:\>dir C:\Options20081112.csv

Volume in drive C has no label.

Volume Serial Number is 1824-0333

Directory of C:\

11/12/2008 04:04 PM 1,300,220 Options20081112.csv

1 File(s) 1,300,220 bytes

0 Dir(s) 40,459,689,984 bytes free

C:\>

I have tried many variations of slashes and back-slashes, but nothing
works.

I am working within pgAdmin under Windows XP.

Please help me preserve my sanity. I do not see that I am doing wrong.

But I am certain it is very simple.

Best Regards

Kevin Duffy

#2brian
brian@zijn-digital.com
In reply to: Kevin Duffy (#1)
Re: simple COPY FROM issue

HINT: Use the escape string syntax for backslashes, e.g., E'\\'.

Try:

COPY imagineoptions FROM E'C:\\Options20081112.csv' ...

or:

COPY imagineoptions FROM 'C:/Options20081112.csv' ...

Kevin Duffy wrote:

Show quoted text

Hello All:

I am attempting to import data from a CSV file.

The command I am using is as follows:

copy imagineoptions from 'C:\\Options20081112.csv' DELIMITERS
',' CSV ;

I get the following:

WARNING: nonstandard use of \\ in a string literal

LINE 1: copy imagineoptions from 'C:\\Options20081112.csv'
DELIM...

^

HINT: Use the escape string syntax for backslashes, e.g., E'\\'.

ERROR: could not open file "C:\Options20081112.csv" for reading: No
such file or directory

SQL state: 58P01

If I run DIR at the command prompt I get:

C:\>dir C:\Options20081112.csv

Volume in drive C has no label.

Volume Serial Number is 1824-0333

Directory of C:\

11/12/2008 04:04 PM 1,300,220 Options20081112.csv

1 File(s) 1,300,220 bytes

0 Dir(s) 40,459,689,984 bytes free

C:\>

I have tried many variations of slashes and back-slashes, but nothing
works.

I am working within pgAdmin under Windows XP.

Please help me preserve my sanity. I do not see that I am doing wrong.

But I am certain it is very simple.

Best Regards

Kevin Duffy