Created
January 31, 2013 16:21
-
-
Save nicdoye/4684054 to your computer and use it in GitHub Desktop.
Count the number of commas in each line. Useful for checking simple CSV (but not proper, quoted CSV).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
new File( args[0] ).eachLine{ it -> println it.count(',') } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment