Site icon Hip-Hop Website Design and Development

handling csv data with a custom post type

I have a custom post type which represents a ‘race’ and there are meta fields for ‘distance’ (5km,10Mile) and ‘type’ (track,road,crosscountry). We get the race results as a csv file which contains the positions and times etc of the runners, each runner is linked to a wordpress user. The intention is to process the csv data and insert it into a custom database table. The results are then displayed via a WP_Table_List. My question is how i should best save the csv data so that it can be processed, the two options as i see are

1 – Save the csv data into the post content section. I’d then add a custom action ‘Process Content CSV’ which reads the content and processes the rows inserting into the database.

2 – As a custom meta field ‘csv_results’ which is setup to accept a file_upload. Once the file is uploaded and the post save, the content of the file is then processes and inserted into the db.

With option one i’d be worried that wordpress will filter out my delimiter char and option 2 seems too complicated. Which approach and what issues would you watch out for?