I have a large CSV file (300MB+) and I want to remove only columns 2,3 and 6-8 using Perl AND remove duplicated rows:

Note 1: all columns are separated by `,` (commas) but sometimes my cell values contains a `,` or multiple `,` and are separated by `"` (see last row, columns 9 and 10); thus I'd like still be able to process the input.csv file even if it has `,` inside the cells:

Note 2: I've added links to the input.csv and output.csv files:

[input.csv](https://www.dropbox.com/s/fxs30dojyovpf1j/input.csv?dl=0)

```
Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9,Col10
info 1,info 2,info 3,...,info 10
address 1,address 2,....,address 10
city 1,city 2,city 3,city 4,city 5,city 6,city 7,city 8,"city 9, extra","city 10, new"

```

[output.csv](https://www.dropbox.com/s/ju9wbrkttykf000/output.csv?dl=0)

```
Col1,Col4,Col5,Col9,Col10
info 1,info 4,info 5,info 9,info 10
address 1,address 4,address 5,address 9,address 10
city 1,city 4,city 5,"city 9, extra","city 10, new"

```

I've found a Perl command that would remove the last column using regex, but don't know if it's good enough or how to tweak it to suit my case (any other suggestion is more than welcomed!):

```
perl -pe 's/.*\K,.*//'

```

Is it possible to remove only columns 2,3 and 6-8 using Perl and remove any duplicated rows?

PS: updated the input.csv file to include duplicate rows as well

Thank you!