Guest User

Untitled

a guest
Feb 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.26 KB | None | 0 0
  1. g = File.new("output.csv", "w")
  2. File.open("input.txt", "r") do |f|
  3.   while (line = f.gets)
  4.     line = line.gsub(/\D/, '')
  5.     g.puts line.chomp.to_s[0,3] + "," + line.chomp.to_s[3,3] + "," + line.chomp.to_s[6,4] + ",," + line.chomp.to_s
  6.   end
  7. end
  8. g.close
Add Comment
Please, Sign In to add comment