Here is a good link for getting started with writing a plug-in: http://msdn.microsoft.com/en-us/library/gg328263.aspx (The link points to CRM 2011, but this is compatible with 2013 and is a good place to get started.)
You'll also want to download the SDK. Provided with the SDK are tools for deploying the plugin, examples of plugins and much, much more. http://www.microsoft.com/en-us/download/details.aspx?id=40321
The CSV file will also be stored as an annotation. Here's an example: http://msdn.microsoft.com/en-us/library/gg328429.aspx
Really, I'd start with the SDK and then look to the specific links.