I'm trying to import data from a fixed width text file in to a Postgres table using COPY command. The said file contains approximately million records with a width of 1450 characters most of which are empty spaces with useful data scattered at predetermined places in every row.
On using the COPY command, PSQL is throwing the following error.
upi=# COPY issuer (stage)
upi-# FROM 'D:/UPI_Inward.txt';
ERROR: literal newline found in data
HINT: Use "\n" to represent newline.
CONTEXT: COPY issuer, line 227040
Please explain what error it is throwing and suggest a way to import the rows from the text file in to Postgres table.
PS: The table "issuer' mentioned in the code contains two columns ID bigint
and stage character varying(1460)
and I'm expecting PSQL to import each row as a single record with an ID number assigned to it.