Sha256: 3d768f19d6de99ce30c22d495baca304ab236e3a97f5daad565e7363b192b5f6

Contents?: true

Size: 427 Bytes

Versions: 17

Compression:

Stored size: 427 Bytes

Contents

#!/usr/bin/env ruby

require "find"

def do_cmd(cmd)
  system cmd
  status = $?
  raise "'#{cmd}' failed with #{status}" if !status.success?
end

files_dir_path = ARGV[0]
output_file = ARGV[1]
files = Find.find(files_dir_path).reject { |p| FileTest.directory?(p) || File.basename(p) == "log" }

files.each_slice(20) do |files_to_concat|
  file_list = files_to_concat.join(' ')
  do_cmd "cat #{file_list} >> #{output_file}"
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
advance-0.4.11 bin/concat_csv_nh.rb
advance-0.4.10 bin/concat_csv_nh.rb
advance-0.4.8 bin/concat_csv_nh.rb
advance-0.4.7 bin/concat_csv_nh.rb
advance-0.4.6 bin/concat_csv_nh.rb
advance-0.4.5 bin/concat_csv_nh.rb
advance-0.4.4 bin/concat_csv_nh.rb
advance-0.4.3 bin/concat_csv_nh.rb
advance-0.4.2 bin/concat_csv_nh.rb
advance-0.4.1 bin/concat_csv_nh.rb
advance-0.3.18 bin/concat_csv_nh.rb
advance-0.3.16 bin/concat_csv_nh.rb
advance-0.3.15 bin/concat_csv_nh.rb
advance-0.3.14 bin/concat_csv_nh.rb
advance-0.3.13 bin/concat_csv_nh.rb
advance-0.3.12 bin/concat_csv_nh.rb
advance-0.3.11 bin/concat_csv_nh.rb