jeffpaine / csvsplit Goto Github PK
View Code? Open in Web Editor NEWSplit a .csv file into multiple files
License: MIT License
Split a .csv file into multiple files
License: MIT License
Seems a little cluttered
To be more idiomatically go, the package documentation ought to be in comments directly above the package main
declaration. The only concern I have is with either having an anemic README.md or having full versions of both but having to keep them in sync.
It should count the lines in a file and pad filenames appropriately. e.g. 001.csv, 002.csv instead of 1.csv, 2.csv. This should default to false as it will require a file to be read twice.
e.g instead of -i
we should use -input
.
This part especially feels wonky
if _, err := os.Stat(fileName); os.IsNotExist(err)...
Add one to each file?
Right now, the header (if it's present in the original) is only printed to the first file.
Or at least make it optional? E.g.
$ csvsplit -records 10 file.csv
Instead of / equivalent to
$ csvsplit -records 10 -input files.csv
Right now it's 1000, should we prompt for it, instead?
Right now, we start with a zero length slice and keep appending to it. https://github.com/JeffPaine/csvsplit/blob/master/main.go#L93
I wonder if it would perform better as a pre-sized array?
Depends on #18, so we can measure our performance before and after.
Should be able to use len() on slice.
Seems more logical
Right now, we auto-append 001, 002, etc. to output filenames. It would be cool to have this zero padding reflect the number of files actually saved (e.g. 01.csv for < 99 files), but I would think that would require us to count (read into memory) all the lines of the file, first.
e.g. -r
and --records
?
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.