Skip to content

Instantly share code, notes, and snippets.

@tjsingleton
Created July 3, 2013 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjsingleton/5914820 to your computer and use it in GitHub Desktop.
Save tjsingleton/5914820 to your computer and use it in GitHub Desktop.
last_line = nil
index = 0
ARGF.each_line do |line|
index += 1
next if index < 35
puts last_line if last_line # skip last line
line.gsub!("#{0x01}\\#{0x01}", "#{0x01}#{0x01}")
line.gsub!("\\", "\\\\")
line.tr!("\r", " ")
line.tr!("\n", " ")
line.gsub!("#{0x02} ", "#{0x02}")
line.tr!("#{0x02}", "\n")
last_line = line
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment