I have a .json file that looks something like this:

```
{
    "Direction": "down",
    "Conversion": "Complete",
    "Version": "v1.0.20170724"
}

```

I want to add a line to the end, so I did this:

```
sed -i '$s/}/,\t"Task":"Yes"}/' data.json

```

Which changes the file to this:

```
{
    "Direction": "down",
    "Conversion": "Complete",
    "Version": "v1.0.20170724"
,   "Task":"Yes"
}

```

Is there a way to have the comma be at the end of second to last line rather than on the last line?