I want to search a txt file for the duplicate lines excluding [p] and the extension in the comparison. Once the equal lines are identified, show only the line that does not contain [p] and with its extension. I have this lines in **test.txt**:

```
Peliculas/Desperados (2020)[p].mp4
Peliculas/La Duquesa (2008)[p].mp4
Peliculas/Nueva York Año 2012 (1975).mkv
Peliculas/Acoso en la noche (1980) .mkv
Peliculas/Angustia a Flor de Piel (1982).mkv
Peliculas/Desperados (2020).mkv
Peliculas/Angustia (1947).mkv
Peliculas/Días de radio (1987) BR1080[p].mp4
Peliculas/Mona Lisa (1986) BR1080[p].mp4
Peliculas/La decente (1970) FlixOle WEB-DL 1080p [Buzz][p].mp4
Peliculas/Mona Lisa (1986) BR1080.mkv

```

In this file lines 1-6 and 9-11 are the same (withouth ext and [p]). Output needed:

```
Peliculas/Desperados (2020).mkv
Peliculas/Mona Lisa (1986) BR1080.mkv

```

i try this but only shows the same lines deleting extension and pattern [p] but i dont know the correct line and I need the entire line complete

`sed 's/\[p\]//' ./test.txt | sed 's\.[^.]*$//' | sort | uniq -d`

Error output (missing extension):

```
Peliculas/Desperados (2020)
Peliculas/Mona Lisa (1986) BR1080

```