Class: CsvCutter::CLI
- Inherits:
-
Thor
- Object
- Thor
- CsvCutter::CLI
- Defined in:
- lib/csv_cutter/cli.rb
Instance Method Summary collapse
Instance Method Details
#split_by_number_rows(file_path, out_dir) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/csv_cutter/cli.rb', line 10 def split_by_number_rows(file_path, out_dir) = .except('number_rows').keys.inject({}) do |, key| [key.to_sym] = [key] end csv = CsvCutter::Csv.new(**.merge(out_dir: out_dir)) csv.split_by_number_rows(file_path: file_path, number_rows: ['number_rows'] || 10000) puts 'Successfully split csv.' end |