parsed.org

Tips by tag: one-liners

Ruby One Liners: Double space a file by Steven on Dec 19, 2007 11:01 AM

At the command line:

$ ruby -pe 'puts' < file.txt
double-spaceone-linersrubyshell

#prints line number 52 from file.txt $ ruby -pe 'next unless $. == 52' < file.txt

one-linersrubyshell
RSS