extra data after last expected column error while trying to import a csv file into postgresql

Viewed 24

I am trying to import the content of a CSV file into my postgresql database, but I got this error "extra data after last expected column".

and I made sure that the number of table columns is the same as CSV file columns!

The table I created:

CREATE TABLE last ( month_year VARCHAR(80), guests INTEGER, guest_nights INTEGER,
 availiable_rooms INTEGER, rooms_occupied INTEGER, rooms_revenues INTEGER, 
occupancy INTEGER, total_revenues INTEGER, alos FLOAT, arr INTEGER, revpar INTEGER);

This is the restore command I use:

COPY last FROM 'D:\dubai 21111.csv' DELIMITER ',' HEADER CSV;

My CSV file:

Month-Year,Guests,Guest Nights,Available Rooms,Rooms Occupied,Room Revenues,Total revenues,Occupancy,ALOS,ARR,REVPAR,,
Jan-19," 436,645 "," 1,198,492 "," 1,007,840 "," 792,018 "," 308,712,202 "," 550,146,939 ",79%,2.7,390,306,,
Feb-19," 406,816 "," 1,062,182 "," 916,732 "," 717,618 "," 333,661,059 "," 569,219,669 ",78%,2.6,465,364,,
Mar-19," 448,966 "," 1,254,879 "," 1,019,931 "," 813,019 "," 329,203,922 "," 604,767,131 ",80%,2.8,405,323,,
Apr-19," 469,028 "," 1,242,142 "," 985,702 "," 772,358 "," 291,233,890 "," 530,327,495 ",78%,2.6,377,295,,
May-19," 303,144 "," 820,842 "," 1,007,785 "," 531,066 "," 153,119,023 "," 324,793,295 ",53%,2.7,288,152,,
Jun-19," 422,448 "," 977,998 "," 972,313 "," 616,503 "," 181,540,071 "," 352,587,821 ",63%,2.3,294,187,,

0 Answers
Related