Skip to content

Instantly share code, notes, and snippets.

@JankyDoodle
Created April 10, 2018 21:19
Show Gist options
  • Save JankyDoodle/d110b41ac5162a263a1db6582dab9ca3 to your computer and use it in GitHub Desktop.
Save JankyDoodle/d110b41ac5162a263a1db6582dab9ca3 to your computer and use it in GitHub Desktop.
require 'csv'
lines = []
fname = "test4029.csv"
somefile = CSV.open(fname, "a")
Dir.glob("C:/Ruby24-x64/bin/TxtFiles/*.txt").each do |file|
File.readlines(file).each do |line|
puts "Processing #{file}"
lines << line
somefile.puts lines
lines.clear
end
end
puts "All finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment