Created
April 13, 2015 22:28
-
-
Save panozzaj/a554cd748827c50243a3 to your computer and use it in GitHub Desktop.
AlphaSmart Neo file dump conversion script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment