{"id":23263101,"url":"https://github.com/knwoop/splitter","last_synced_at":"2025-12-15T21:02:22.631Z","repository":{"id":57529874,"uuid":"263955399","full_name":"knwoop/splitter","owner":"knwoop","description":"A small Go utility for splitting a file into smaller ones.","archived":false,"fork":false,"pushed_at":"2020-05-19T15:28:46.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T22:56:15.554Z","etag":null,"topics":["file-split","file-splitter","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knwoop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-14T15:38:46.000Z","updated_at":"2023-08-09T16:42:23.000Z","dependencies_parsed_at":"2022-09-26T21:31:28.372Z","dependency_job_id":null,"html_url":"https://github.com/knwoop/splitter","commit_stats":null,"previous_names":["knwoop/go-splitter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/knwoop/splitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knwoop%2Fsplitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knwoop%2Fsplitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knwoop%2Fsplitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knwoop%2Fsplitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knwoop","download_url":"https://codeload.github.com/knwoop/splitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knwoop%2Fsplitter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27756993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-15T02:00:09.782Z","response_time":96,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-split","file-splitter","go","golang"],"created_at":"2024-12-19T14:14:47.027Z","updated_at":"2025-12-15T21:02:22.597Z","avatar_url":"https://github.com/knwoop.png","language":"Go","readme":"# splitter\n\nA small Go utility for splitting a file into smaller ones.\n\n## Installation\n```shell script\n$ go get -u github.com/knwoop/splitter\n```\n\n## sample cmd\n```shell script\n$ splitter -path _example/example.csv -sep 3 -head \n```\n\n## how to use\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"os\"\n    \n    \"github.com/knwoop/splitter\"\n)\n\nfunc main() {\n    f, err := os.Open(\"test.csv\")\n    if err != nil{\n        log.Fatal(err)\n    }\n    defer f.Close() \n    readers, err := splitter.Split(f, true, 40)\n    if err != nil {\n        log.Fatal(err)\n    }\n    ...\n}\n```\n\n## Let's playground\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/knwoop/splitter\"\n)\n\nvar csv = `header1,header2\n\"1111\",\"22222\"\n33333,44444\n55555,66666\n77777,88888`\n\nfunc main() {\n\tr := strings.NewReader(csv)\n\treaders, err := splitter.Split(r, true, 3)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tbuf1 := new(bytes.Buffer)\n\tif _, err := buf1.ReadFrom(readers[0]); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tbuf2 := new(bytes.Buffer)\n\tif _, err := buf2.ReadFrom(readers[1]); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(buf1)\n\tfmt.Println(buf2)\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknwoop%2Fsplitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknwoop%2Fsplitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknwoop%2Fsplitter/lists"}