smarter_csv
smarter_csv copied to clipboard
Ruby Gem for smarter importing of CSV Files as Array(s) of Hashes, with optional features for processing large files in parallel, embedded comments, unusual field- and record-separators, flexible mapp...
* SmarterCSV used instance variables on a module, so they were shared across all threads * When different threads ran SmarterCSV, they could overwrite the instance values that were set,...
## Adding Experimental v2 Features 🧪 🌶️ This PR adds the features from the 2.0-develop branch to the main branch, but as hidden / experimental features. The intent is that...
## Summary: This pull request enhances the logic used to determine the column separator (delimiter) in CSV files processed by our system. Previously, the method guess_column_separator simply counted occurrences of...
This gem looks amazing and like it would solve a lot of CSV parsing issues I run into over and over. Of particular usefulness is the `hash_transformations` and `header_transformations` I...
when headers are given, it should default to `headers_in_file: false`, to limit potential risk of losing the first data line in the file.
Actual output: ``` $ cat cats.csv first name,last name,dogs,cats,birds,fish Dan,McAllister,2,1,"2,4 Lucy,Laweless,,5,, Miles,O'Brian,,,,21 Nancy,Homes,2,,1, x = SmarterCSV.process('/Users/Me/Documents/parentsquare/parent_square/cats.csv', options: {verbose: true}) EOFError: end of file reached from /Users/Me/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/smarter_csv-1.2.8/lib/smarter_csv/smarter_csv.rb:141:in `readline' ``` Expected output:...
Now there's no way to get these outside of parsing the error message. Having this is useful to display a user-facing error message.
``` ~/code/ruby/smarter_csv >sw_vers ProductName: macOS ProductVersion: 15.5 BuildVersion: 24F74 ~/code/ruby/smarter_csv >uname -a Darwin Mac.fios-router.home 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:29 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6030 arm64 ``` `bundle install`in'...
## Summary While processing a CSV file with SmarterCSV, I encountered unexpected Duplicate Headers in CSV errors on rows that appear to be structurally valid. The same CSV parses cleanly...