Skip to content

Instantly share code, notes, and snippets.

@mshock
Created May 15, 2012 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mshock/2702631 to your computer and use it in GitHub Desktop.
Save mshock/2702631 to your computer and use it in GitHub Desktop.
CSV column compare, one liner
perl -F, -ape'$_<($x=length$F[i])and$_=$x' file.csv
@mshock
Copy link
Author

mshock commented May 15, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment