write sparse three column file