I am trying to import a large file text file (100k rows, x columns, delimiter is ';') into postgresql 9.6, pgadmin4, in windows 10 using 

```
COPY my_table FROM 'E:\DATA\my_file.txt' (DELIMITER(';');

```

A small number of rows in the text file do have more than x columns; as a result I get the “ERROR: extra data after last expected column” message. This is due to things like `; ; ;` 

I am looking for a way to detect those rows and delete them with something like a trigger instead of insert. 

Thanks for your quick answer, but is there a way to clean the data with postgresql? 
I am thinking of something like (pseudocode) :

```
CREATE my_table(x columns);
CREATE funtion import_csv(csv_file,my_table){
    for i = 1 to count_rows(csv_file){
        if count_columns.csv_file.row(i)<>x{
            Skip csv_file.row(i);
        }else{
            insert csv_file.row(i) in my_table;
        }
    }
}

```

or something similar with Delete instead of Skip.

Thanks