Question: I have a file that looks like this:

```
@"Afghanistan.png",
@"Albania.png",
@"Algeria.png",
@"American_Samoa.png",

```

I want it to look like this

```
@"Afghanistan.png",
@"Afghanistan",
@"Albania.png",
@"Albania",
@"Algeria.png",
@"Algeria",
@"American_Samoa.png",
@"American_Samoa",

```

I thought I could use sed to do this but I can't figure out how to store something in a buffer and then modify it.

Am I even using the right tool?

Thanks

Answer: 
Glenn jackman's response is OK, but it also doubles the rows which do not match the expression.

This one, instead, doubles only the rows which matched the expression:

```
sed -n 'p; s/\.png//p'

```

Here, -n stands for "print nothing unless explicitely printed", and the p in `s/\.png//p` forces the print if substitution was done, but does not force it otherwise
or one can combine both versions and apply the duplication only on lines matching the required pattern

```
sed -e '/^@".*\.png",/{p;s/\.png//;}' input

```