#!/usr/bin/ruby -w cursor = 0 ARGF.each_char{|c| case c when "\t" print " " * (8 - cursor % 8) cursor += 8 - cursor % 8 when "\n" print "\n" cursor = 0 else print c cursor += 1 end }