process_data_file function

Process a data file using metadata and codes dictionary