Just running a test! showhide Real's HowTo
Posts
Showing posts from April, 2009
Textmate Ruby Macro Remove Blank Lines
- Get link
- Other Apps
By
Steve Morin
Textmate Ruby Macro Comma Separated List to Line
- Get link
- Other Apps
By
Steve Morin
Textmate Ruby Macro Lines to Comma Separated List
- Get link
- Other Apps
By
Steve Morin
- Get link
- Other Apps
By
Steve Morin
Looks useful thanks David Thomas Original Link HANDY ONE-LINERS FOR RUBY November 16, 2005 compiled by David P Thomas version 1.0 Latest version of this file can be found at: http://www.fepus.net/ruby1line.txt Last Updated: Wed Nov 16 08:35:02 CST 2005 FILE SPACING: # double space a file $ ruby -pe 'puts' < file.txt # triple space a file $ ruby -pe '2.times {puts}' < file.txt # undo double-spacing (w/ and w/o whitespace in lines) $ ruby -lne 'BEGIN{$/="\n\n"}; puts $_' < file.txt $ ruby -ne 'BEGIN{$/="\n\n"}; puts $_.chomp' < file.txt $ ruby -e 'puts STDIN.readlines.to_s.gsub(/\n\n/, "\n")' < file.txt NUMBERING: # number each line of a file (left justified). $ ruby -ne 'printf("%-6s%s", $., $_)' < file.txt # number each line of a file (right justified). $ ruby -ne 'printf("%6s%s", $., $_)' < fi