{"id":19151719,"url":"https://github.com/zhs007/xlsx2csv","last_synced_at":"2025-10-08T01:52:26.899Z","repository":{"id":32096016,"uuid":"35668206","full_name":"zhs007/xlsx2csv","owner":"zhs007","description":null,"archived":false,"fork":false,"pushed_at":"2018-04-03T02:37:55.000Z","size":57,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-01T12:46:50.330Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/zhs007.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":"2015-05-15T10:27:35.000Z","updated_at":"2018-04-03T02:37:56.000Z","dependencies_parsed_at":"2022-09-15T18:40:58.926Z","dependency_job_id":null,"html_url":"https://github.com/zhs007/xlsx2csv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zhs007/xlsx2csv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhs007%2Fxlsx2csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhs007%2Fxlsx2csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhs007%2Fxlsx2csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhs007%2Fxlsx2csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhs007","download_url":"https://codeload.github.com/zhs007/xlsx2csv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhs007%2Fxlsx2csv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278352121,"owners_count":25972894,"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-10-04T02:00:05.491Z","response_time":63,"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":[],"created_at":"2024-11-09T08:15:32.342Z","updated_at":"2025-10-08T01:52:26.870Z","avatar_url":"https://github.com/zhs007.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xlsx2csv\n\n批量的将xlsx或xls文件转换为csv或json格式的命令行工具。\n\n配合 [ds-lang](https://github.com/zhs007/ds-lang) 使用，可以实现从数据建模一直到最终的数据加载都一键操作。\n\n编码集\n---\n只支持utf-8。\n\ncsv文件格式\n---\n我们仅支持excel的windows版本默认导出的csv格式。\n\n格式以**\",\"**作为列的分隔，**\"\\r\\n\"**作为行的分隔。\n\n如果内容中存在**\",\"**，这段内容会被引号引用起来。\n\njson文件格式\n---\njson格式紧密没有做过多的格式化，但一般来说，json格式会比csv大很多。\n\n转换格式的时候，如果当前字段是一个int或者是一个float，就不会转换为字符串。\n\n\n安装\n---\n\n```\nnpm install xlsx2csv -g\n```\n\n使用\u0026命令行参数\n---\n**xlsx2csv** 和 **xlsx2json** 用法几乎一样，就是输出文件格式不同。\n\n* 基本用法 - 传入目录，即可将目录下所有xlsx或xls文件转换为csv格式。\n\n```\nxlsx2csv [path]\n```\n\n\u003e 注意：默认情况下，csv的文件名和xlsx文件名一致，且只导出excel文件的第一张表。\n\n* 遍历子目录 - 支持遍历子目录。\n\n```\nxlsx2csv **/win32/*.*\n```\n\n\u003e 注意：即便是遍历 ```*.*``` ，最后也只会处理 ```*.xlsx``` 和 ```*.xls``` 2种扩展名的文件。\n\n* 排除某一行 - 配合 [ds-lang](https://github.com/zhs007/ds-lang) 使用时，由于 [ds-lang](https://github.com/zhs007/ds-lang) 默认定义第一行为注释行，所以我们会需要文件转换时排除第一行，可以这样使用。\n\n```\nxlsx2csv [path] -e=0\n```\n\n* 导出多表 - excel文件可能会有多张表，我们可以根据表名来导出多张表。\n\n```\nxlsx2csv [path] -t\n```\n\n\u003e 注意：这种情况下，会建一层xlsx文件名的目录，且csv的文件名和xlsx表名一致。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhs007%2Fxlsx2csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhs007%2Fxlsx2csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhs007%2Fxlsx2csv/lists"}