Refactor CSV export in pixelpulse and oneshot.