Created
March 18, 2011 19:45
-
-
Save jrpz/876704 to your computer and use it in GitHub Desktop.
Combine text based files within a directory into a single file. Requires 'directory' and 'file' parameters.
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
dir = Dir.new(ARGV[0]) | |
file = File.open(ARGV[1], 'w') | |
dir.each{|d| | |
if (d[0] != '.') | |
f = File.open(ARGV[0] + d) | |
file.write(f.read) | |
f.close | |
end | |
} | |
file.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment