I am trying to import data from a CSV file separated by ';' and with string values surrounded by double quotes: "
missing separator ';' line 225387 expecting 8 got 7 fields
missing separator ';' line 75129 expecting 8 got 7 fields
missing separator ';' line 0 expecting 8 got 7 fields
missing separator ';' line 450774 expecting 8 got 7 fields
missing separator ';' line 300516 expecting 8 got 7 fields
missing separator ';' line 150258 expecting 8 got 7 fields
missing separator ';' line 525903 expecting 8 got 7 fields
missing separator ';' line 375645 expecting 8 got 7 fields
failed to import table
I am using the following command:
copy 300000000 offset 2 records into mobilidade.ligacoes from '/Users/fccoelho/Documents/dados_mobilidade/bilhetagem.txt' using delimiters ';','\n','"' ;
after creating the table like this:
sql dump of my table:
CREATE TABLE "mobilidade"."ligacoes" (
"id" INTEGER NOT NULL DEFAULT next value for "mobilidade"."seq_5840",
"DT_INI_ATIVIDADE_REDE" VARCHAR(10),
"HR_INI_ATIVIDADE_REDE" VARCHAR(7),
"NU_SETOR_CELULA_ORIG" INTEGER,
"NU_AREA_CELULA_ORIG" INTEGER,
"NU_DDD_ORIG" INTEGER,
"NU_DDD_DESTINO" INTEGER,
"CD_TELEFONE_ORIG_ALTER" INTEGER DEFAULT NULL,
"CD_TELEFONE_DESTINO_ALTER" VARCHAR(16) DEFAULT NULL,
CONSTRAINT "ligacoes_id_pkey" PRIMARY KEY ("id")
);
Naturally, I checked line 0 and it does have 8 fields.
What am I doing wrong?
--
Flávio Codeço Coelho