Created
May 15, 2012 15:25
-
-
Save mshock/2702631 to your computer and use it in GitHub Desktop.
CSV column compare, one liner
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
perl -F, -ape'$_<($x=length$F[i])and$_=$x' file.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found myself doing this a lot for specifying sane database column sizes before an import. Can be tweaked to do all sorts of things.
Replace i with the column to be examined.