Also, definitely check out the CSVtoHistory script included with Zorro for some excellent sample code.

Not all CSVs are made the same, so you will need to edit the CSV format to suit. See, you have different kinds of time stamps and field values to work with. Plus the sort order can be backwards.