Convert database records into a structured format.