optimize csv import

courtesy of Florent Coriat