Skip to content

Instantly share code, notes, and snippets.

View hitesh-goel's full-sized avatar
🏠
Working from home

Hitesh Goel hitesh-goel

🏠
Working from home
  • New Delhi (India)
  • 22:36 (UTC +05:30)
View GitHub Profile
@hitesh-goel
hitesh-goel / csvsplit.rb
Last active May 14, 2023 08:55 — forked from pnomolos/csvsplit.rb
Splits a CSV file into multiple, smaller chunks.
#!/usr/bin/env ruby -w
file = "products.csv"
lines_per_file = 20000
header_lines = 1
extension = File.extname(file)
basename = File.basename(file, extension)
File.open(file) do |f|