print every fifth character in a file:
f = File.new("test.txt", "r") while a = f.getc puts a.chr f.seek(5, IO::SEEK_CUR) end