Extract and write