Skip to content

Instantly share code, notes, and snippets.

@timrwilliams
Last active January 3, 2018 12:25
Show Gist options
  • Save timrwilliams/d43bba77ddede2af0478cdb2eb86ca35 to your computer and use it in GitHub Desktop.
Save timrwilliams/d43bba77ddede2af0478cdb2eb86ca35 to your computer and use it in GitHub Desktop.
Count number of unique keys and words in a Rails translation file
awk '{ if( $1 != "#" ){ print $0 } }' en.yml | awk -F':' '{print $2}' | awk 'NF'
@timrwilliams
Copy link
Author

Strip Comments | Extract words after a key definition (e.g. en.title: "My Title" extracts just "My Title") | remove blank lines | count words

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