I have a 30 GB delimited text file that contains more than 100 million rows, when I want to import this text file into a PostgreSQL table using the \ copy command, some lines cause an error. how can I ignore these lines and also take a record of ignored lines when importing into postgresql?
I am connecting to my SSH machine, so I cannot use pgadmin!
It is very difficult to edit a text file before importing, because many different lines have different problems. if there is a way to check the lines one by one before importing and then run the \ copy command on individual lines, that would be useful.
Below is the code that the table generates:
CREATE TABLE Papers(
Paper_ID CHARACTER(8) PRIMARY KEY,
Original_paper_title TEXT,
Normalized_paper_title TEXT,
Paper_publish_year INTEGER,
Paper_publish_date DATE,
Paper_Document_Object_Identifier TEXT,
Original_venue_name TEXT,
Normalized_venue_name TEXT,
Journal_ID_mapped_to_venue_name CHARACTER(8),
Conference_ID_mapped_to_venue_name CHARACTER(8),
Paper_rank BIGINT,
FOREIGN KEY(Journal_ID_mapped_to_venue_name) REFERENCES Journals(Journal_ID),
FOREIGN KEY(Conference_ID_mapped_to_venue_name) REFERENCES Conferences(Conference_ID));