{"id":22031257,"url":"https://github.com/erremauro/csvbot","last_synced_at":"2025-06-14T23:04:02.483Z","repository":{"id":91035909,"uuid":"114418468","full_name":"erremauro/csvbot","owner":"erremauro","description":"Rearrange and rename columns in csv files and move them around","archived":false,"fork":false,"pushed_at":"2017-12-15T23:11:07.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T11:31:00.362Z","etag":null,"topics":["copy","csv","move","rename"],"latest_commit_sha":null,"homepage":null,"language":"C#","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/erremauro.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-15T23:10:43.000Z","updated_at":"2017-12-15T23:12:04.000Z","dependencies_parsed_at":"2023-07-07T07:00:31.716Z","dependency_job_id":null,"html_url":"https://github.com/erremauro/csvbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/erremauro/csvbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erremauro%2Fcsvbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erremauro%2Fcsvbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erremauro%2Fcsvbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erremauro%2Fcsvbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erremauro","download_url":"https://codeload.github.com/erremauro/csvbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erremauro%2Fcsvbot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259896127,"owners_count":22928330,"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","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":["copy","csv","move","rename"],"created_at":"2024-11-30T08:15:19.090Z","updated_at":"2025-06-14T23:04:02.457Z","avatar_url":"https://github.com/erremauro.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csvbot\n\nCSVBot is an utility to move, copy and rename columns in a `*.csv` file by\ndefining a `FileStrategy` and `Directives`.\n\n## Table of content\n\n- [Configurations](#configurations)\n- [Defining a Source](#defining-a-source)\n- [File Strategies](#file-strategies)\n  - [Accepted overwrite values](#accepted-overwrite-attribute-values)\n  - [Moving and copying a group of iles](#moving-and-copying-a-group-of-files)\n- [Directive](#directives)\n  - [Accepted directive attributes](#accepted-directives-attributes)\n- [Separator](#separator)\n- [Logs](#logs)\n\n## Configurations\n\nAll configurations can be specified in `config.xml` via xml Elements and\nattributes inside the `\u003cConfig\u003e\u003c/Config\u003e` root node.\n\nHere's a `config.xml` example:\n\n```xml\n\u003cConfig\u003e\n  \u003cSource path=\"C:\\mycsv\" /\u003e\n  \u003cFileStrategy\u003e\n    \u003cMove path=\"\\\\151.92.85.30\\shared\" overwrite=\"skip\" /\u003e\n    \u003cCopy path=\"D:\\processed\" with=\"txt\" /\u003e\n  \u003c/FileStrategy\u003e\n  \u003cGroupedWith\u003etxt,tif\u003c/GroupedWith\u003e\n  \u003cDirectives\u003e\n    \u003cDirective position=\"12\" action=\"copy\" to=\"1\" rename=\"Custom ID\" /\u003e\n    \u003cDirective position=\"3\" rename=\"Image Name\" /\u003e\n    \u003cDirective position=\"7\" action=\"move\" to=\"4\" /\u003e\n  \u003c/Directive\u003e\n  \u003cSeparator\u003e;\u003c/Separator\u003e\n\u003c/Config\u003e\n```\n\n## Defining a source\n\nA source can be a `file` or `directory` and is a required parameter in order for\nthe application to work. \n\nWhen a directory is specified, csvbot  will process all `*.csv` files found in \nthat directory by applying all `FileStrategy` and `Directives` to each file.\n\nTo specify a source use a `Source` element inside the `Config` root node:\n\n```xml\n\u003cConfig\u003e\n  \u003cSource path=\"C:\\path\\to\\source\" /\u003e\n\u003c/Config\u003e\n```\n\n## File Strategies\n\nA `FileStrategy` tells csvbot what to do with the file once all `Directives`\nhas been applied. If no `FileStrategy` is specified, csvbot will overwrite the\nprocessed file directly in the source.\n\nYou can specify how many `FileStrategy` you want; so you can, for example, move\nthe file to a location and copy it to another.\n\nTo specify a `FileStrategy` use a `Move` or a `Copy` element inside a \n`FileStrategy` container in a `Config` root node. Each `FileStrategy` requires a \npath and optional `overwrite` attribute. Additionally you can specify a `with`\nattribute to define a set of comma separated extesions that will match the\nsource filename and, if found, copied along.\n\n```xml\n\u003cConfig\u003e\n  \u003cFileStrategy\u003e\n    \u003cCopy path=\"D:\\processed_files\" overwrite=\"false\" /\u003e\n    \u003cMove path=\"\\\\my-host\\shared\" /\u003e\n  \u003c/FileStrategy\u003e\n\u003c/Config\u003e\n```\n\n### Accepted overwrite attribute values\n\nHere's a list of every accepted overwrite attribute values. When an `overwrite` \nattribute is not specified, csvbot will assume the default value of `true`.\n\n| Value | Description                                                        |\n|-------|--------------------------------------------------------------------|\n| true  | Default value. Overwrites existing files                           |\n| false | Do not overwrite existing files and halt the program with an error |\n| skip  | Do not overwrite existing files and continue without notice        |\n\n### Moving and Copying a group of files\n\nYou can use a `GroupedWith` container or a `FileStrategy`'s `with` attribute to\nmove or copy a group of additinal files besides your csv.\n\n```xml\n\u003cConfig\u003e\n  \u003cFileStrategy\u003e\n    \u003cCopy path=\"D:\\processed_files\" /\u003e\n    \u003cMove path=\"\\\\my-host\\shared\" with=\"txt,tiff\" /\u003e\n  \u003c/FileStrategy\u003e\n  \u003cGroupedWith\u003etxt\u003c/GroupedWith\u003e\n\u003c/Config\u003e\n```\n\nCsvbot will search the source directory for files with identical name but \nof specified extensions and it will move or copy those files along. Use a\n`GroupedWith` container to apply this behavior to every `FileStrategy` or a \n`FileStrategy`'s `with` attribute to apply the behavior to selected strategies.\n\n## Directives\n\nUse `Directives` to instruct csvbot on how to manipulate your `*.csv` files, by\ngiving the column `position` and an optional `action` of `move` or  `copy` with\nrelated `to` position. You can also specify an optional `rename` attribute to\nrename your column.\n\nList your directives as child of a `Directives` element inside the `Config` root\nnode:\n\n```xml\n\u003cConfig\u003e\n  \u003cDirectives\u003e\n    \u003cDirective position=\"12\" action=\"copy\" to=\"1\" rename=\"Custom ID\" /\u003e\n    \u003cDirective position=\"3\" action=\"move\" to=\"4\" /\u003e\n    \u003cDirective position=\"7\" rename=\"Image Name\" /\u003e\n  \u003c/Directives\u003e\n\u003c/Config\u003e\n```\n\n### Directive attributes\n\nHere's the accepted directive attributes\n\n| Parameter | Type    | Description                                                   |\n|-----------|---------|---------------------------------------------------------------|\n| position  | integer | Required column position                                      |\n| action    | string  | Optional action name. Can be: _move_ or _copy_                |\n| to        | integer | Define new position if _move_ or _copy_ action are specified. |\n| rename    | string  | Optional column header new name                               |\n\n## Separator\n\nYou can specify a custom csv separator in a `Separator` element inside the\n`Config` root node:\n\n```xml\n\u003cConfig\u003e\n  \u003cSperator\u003e;\u003c/Separator\u003e\n\u003c/Config\u003e\n```\n\n## Logs\n\nA `log.txt` file is written for debugging purposes in the csvbot directory. \nThe log file is automatically rolled when the file size is over 1MB.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferremauro%2Fcsvbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferremauro%2Fcsvbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferremauro%2Fcsvbot/lists"}