csvkit icon indicating copy to clipboard operation
csvkit copied to clipboard

csvclean: options for stdout and stderr

Open eadmaster opened this issue 12 years ago • 7 comments
trafficstars

to output the fixed file on stdout and errors on stderr

eadmaster avatar Dec 28 '12 07:12 eadmaster

This def makes sense as an option. Should be a quick fix for a future release.

onyxfish avatar Dec 28 '12 13:12 onyxfish

This feature would be greatly appreciated. I like using csvclean piping in only some rows from sed. When you've got close to a million records passing it all through at once isn't all that helpful. I can't save the output since the file appears to be based on base, which is presumably the file name pass when calling csvclean (see line #37).

If you could send the output to stdout, data flowing from stdin can be more easily saved.

Another feature that may make sense while making this change is specifying the output file path. Looks like you'd have to modify from use base to an argument and using base + '_out' as a fallback.

I'd make the change myself, but I've only done light scripting in Python and am not great at following OO code.

jsonbecker avatar May 13 '14 22:05 jsonbecker

Loving csvkit. Would be even better if csvclean could send to stdout so I could include as part of a longer pipe. Wonder if this feature is on the roadmap ?

cburkins avatar Oct 31 '15 14:10 cburkins

What I think would be awesome is to have an option to make exit csvclean with a non 0 status code if errors are detected. That would make it easy to integrate it as a csv lint tool.

Jenselme avatar Nov 11 '15 15:11 Jenselme

To do:

  • STDOUT for output
  • STDERR for errors
  • non-0 exit status if errors

jpmckinney avatar Jan 28 '17 22:01 jpmckinney

Any word on this?

scoleri avatar Mar 08 '21 14:03 scoleri

There's a PR #781

For now you can use it with:

pip install --upgrade -e git+https://github.com/wireservice/csvkit.git@csvclean#egg=csvkit

jpmckinney avatar Mar 12 '21 00:03 jpmckinney