Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- g = File.new("output.csv", "w")
- File.open("input.txt", "r") do |f|
- while (line = f.gets)
- line = line.gsub(/\D/, '')
- g.puts line.chomp.to_s[0,3] + "," + line.chomp.to_s[3,3] + "," + line.chomp.to_s[6,4] + ",," + line.chomp.to_s
- end
- end
- g.close
Add Comment
Please, Sign In to add comment