Skip to content

Instantly share code, notes, and snippets.

@panozzaj
Created April 13, 2015 22:28
Show Gist options
  • Save panozzaj/a554cd748827c50243a3 to your computer and use it in GitHub Desktop.
Save panozzaj/a554cd748827c50243a3 to your computer and use it in GitHub Desktop.
AlphaSmart Neo file dump conversion script
#!/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