in reply to Re-ordering data in data file

I'd go for setting $/ (input_record_separator) so that you read a whole logical record at a time; that makes the numbering and editing a lot easier:
{ local $/ = "}\n"; while (<>) { s/^"\d+"/"$."/; print; } }
(This is based on your later clarification that the records themselves do not need to be re-ordered according to the original record numbers before assigning the new sequential record numbers.)