Move the cursor before printing status mesasge

This way it doesn't scroll the console
Be more performant about parsing id/title
Close and rename file when done