Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- # Takes a NEO import and converts it into more readable files and filenames
- require 'fileutils'
- (1..8).to_a.each do |filenum|
- filename = "File #0#{filenum}.txt"
- if File.exist?(filename)
- FileUtils.cp filename, "#{filenum}.txt"
- end
- end
- (1..8).to_a.each do |filenum|
- filename = "#{filenum}.txt"
- if File.exist?(filename)
- lines = File.read(filename).split(/\r/)
- File.open(filename, 'w') do |f|
- f.puts lines.join("\n")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement