Created
March 5, 2012 09:56
-
-
Save tychobrailleur/1977689 to your computer and use it in GitHub Desktop.
Remove auto_increment in sql script; good ruby example on how to process a file
This file contains hidden or 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
file_names = ['script.sql'] | |
file_names.each do |file_name| | |
text = File.read(file_name) | |
File.open(file_name, 'wb') do | |
|file| | |
file.write(text.gsub(/\s*AUTO_INCREMENT\s*(\=\s*[0-9]+)?/, "")) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment