Created
October 26, 2011 22:02
-
-
Save Andrzej/1318027 to your computer and use it in GitHub Desktop.
Sort file by regex
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
r=/".+"/; puts File.readlines("file.txt").sort{|a,b| a[r] <=> b[r]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment