I deleted lines in a file with
:g/^\s*key3/d
and now have a file like this:
entry{entryname1,
key1 = {text},
key2 = {text},
}
entry{entryname2,
anotherkey = {text},
yetanotherkey = {text}
}
...
I want to delete the trailing comma after key2 (the name of the last key can change) on multiple lines in the file.
Is there a command (or multiple commands) that does the following:
for each line with the pattern ^}$:
if the last character in the previous line is a comma:
delete that comma