Skip to content

Instantly share code, notes, and snippets.

@RobFreiburger
Created November 13, 2009 13:28
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 RobFreiburger/233824 to your computer and use it in GitHub Desktop.
Save RobFreiburger/233824 to your computer and use it in GitHub Desktop.
Sort CSV entries like Facebook profile favorites alphabetically.
#!/usr/bin/perl
# Sorts CSVs alphabetically and formats
use strict;
my @csv = split(/,\s?/, join(' ', @ARGV));
@csv = sort @csv;
for (my $i = 0; $i < $#csv; $i++) {
$csv[$i] .= ",";
}
print "\n@csv\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment