apbendi / csvsuite Goto Github PK
View Code? Open in Web Editor NEWBasic utilities for handling csv's
Basic utilities for handling csv's
Produces the following error, coming from w/in the CSV class
/opt/local/lib/ruby1.9/1.9.1/csv.rb:1925:in block (2 levels) in shift': Illegal quoting in line 2. (CSV::MalformedCSVError) from /opt/local/lib/ruby1.9/1.9.1/csv.rb:1887:in
each'
from /opt/local/lib/ruby1.9/1.9.1/csv.rb:1887:in block in shift' from /opt/local/lib/ruby1.9/1.9.1/csv.rb:1849:in
loop'
from /opt/local/lib/ruby1.9/1.9.1/csv.rb:1849:in shift' from /opt/local/lib/ruby1.9/1.9.1/csv.rb:2273:in
parse_headers'
from /opt/local/lib/ruby1.9/1.9.1/csv.rb:1955:in block in shift' from /opt/local/lib/ruby1.9/1.9.1/csv.rb:1849:in
loop'
from /opt/local/lib/ruby1.9/1.9.1/csv.rb:1849:in shift' from /opt/local/lib/ruby1.9/1.9.1/csv.rb:1791:in
each'
from /opt/local/lib/ruby1.9/1.9.1/csv.rb:1805:in to_a' from /opt/local/lib/ruby1.9/1.9.1/csv.rb:1805:in
read'
from /Users/ben/scripts/csvsuite/lib/suitecsv.rb:16:in initialize' from dre_merge5.rb:4:in
new'
from dre_merge5.rb:4:in `
Opening a CSV file that is only the header row does not produce the expected behavior. For example, if the complete CSV file called my_headers.csv is:
Header1,Header2,Header3
...then currently:
header_csv = SuiteCSV.new 'my_headers.csv'
header_csv.headers
....produces NO output. It should produce:
Header1
Header2
Header3
We need these!
Says something is different when it doesn't appear to be:
<<#CSV io_type:File io_path:"sample1-full_merge_ans.csv" encoding:UTF-8 lineno:44 col_sep:"," row_sep:"\n" quote_char:""" headers:["Internal ID", "First Name", "Last Name", "Party", "Home State", "Zip"]>> expected but was
<<#CSV io_type:File io_path:"sample1-full_merge_mer.csv" encoding:UTF-8 lineno:44 col_sep:"," row_sep:"\n" quote_char:""" headers:["Internal ID", "First Name", "Last Name", "Party", "Home State", "Zip"]>>.
The headers of a SuiteCSV are set at initialization, but not automatically updated. If a new column is implicitly added by adding it to any given row, this is not reflected in the headers unless you are careful to also add said column to the headers themselves.
NOTE: The headers of a CSV::Table are determined by the headers of the first CSV::Row in said Table.
Current testing of Join only tests for things being included which shouldn't be...we should also test for things not included that should have been. Consider doing a Join & Unjoin and comparing both files to each other?
This is really a symptom of #1. To be safe, you must first run a combine, then write to a file, load the file, and run subsequent combine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.