Textmate Ruby Macro Remove Blank Lines
Textmate Ruby Macro Remove Blank Lines
#!/usr/bin/env ruby -wKU
STDIN.readlines.each {|e| print e unless e =~ /^\n/}
#Set Save "Nothing"
#Set Input "Selected Text" or "Character"
# and
#Set Output "Replace Selected Text"
#!/usr/bin/env ruby -wKU
STDIN.readlines.each {|e| print e unless e =~ /^\n/}
#Set Save "Nothing"
#Set Input "Selected Text" or "Character"
# and
#Set Output "Replace Selected Text"
Comments
#!/usr/bin/env ruby
example = "\naba\n\t\n\n\n \navccc"
example.each_line{ |line| print line unless line =~ /^\s*\n/