{"id":19643095,"url":"https://github.com/americanhanko/columnmapper","last_synced_at":"2025-09-05T18:40:47.941Z","repository":{"id":115490241,"uuid":"180640663","full_name":"americanhanko/ColumnMapper","owner":"americanhanko","description":"A simple VLOOKUP-like function that can handle duplicates.","archived":false,"fork":false,"pushed_at":"2020-03-23T17:40:39.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T23:26:50.676Z","etag":null,"topics":["csv","duplicate-detection","duplicates","vlookup"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","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/americanhanko.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":"2019-04-10T18:28:05.000Z","updated_at":"2023-09-08T17:52:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"e88eb3f6-2386-4267-8bca-4f6210c344d9","html_url":"https://github.com/americanhanko/ColumnMapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/americanhanko/ColumnMapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanhanko%2FColumnMapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanhanko%2FColumnMapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanhanko%2FColumnMapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanhanko%2FColumnMapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/americanhanko","download_url":"https://codeload.github.com/americanhanko/ColumnMapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanhanko%2FColumnMapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273802630,"owners_count":25171107,"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-09-05T02:00:09.113Z","response_time":402,"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":["csv","duplicate-detection","duplicates","vlookup"],"created_at":"2024-11-11T14:18:51.153Z","updated_at":"2025-09-05T18:40:47.931Z","avatar_url":"https://github.com/americanhanko.png","language":"PowerShell","readme":"# ColumnMapper\n\nConsolidate duplicate row values and create new columns for each unique value found in a corresponding column.\n\n## Getting Started\n\nThe `ColumnMapper` module exports a single function `Invoke-ColumnMapper` and an alias to it `cmap`. It requires one parameter `InputPath` which may be an absolute or relative path to the input CSV file containing the data you wish to map.\n\nTo install the `ColumnMapper` module, open PowerShell and run the following command:\n\n```powershell\nInstall-Module -Name ColumnMapper -Scope CurrentUser\n```\n\n## Usage\n\n### Basic\n\nUsing the function:\n\n```\nInvoke-ColumnMapper -InputPath C:\\path\\to\\data.csv\n```\n\nor using the alias:\n\n```\ncmap -InputPath C:\\path\\to\\data.csv\n```\n\n### Full Syntax\n\n```powershell\nInvoke-ColumnMapper [[-InputPath] \u003cObject\u003e] [[-KeysHeader] \u003cObject\u003e] [[-OutputPath] \u003cObject\u003e] [[-ValuesHeader] \u003cObject\u003e] [-NoExport] [-Open] [\u003cCommonParameters\u003e]\n```\n\n### Parameters\n\n    -InputPath \u003cObject\u003e\n        The absolute or relative path to the input CSV file.\n\n    -KeysHeader \u003cObject\u003e\n        Specifies the column name to search in for the row identifiers.\n        ColumnMapper will use these values as the primary row identifiers.\n        Defaults to '[PO] Order Id' for legacy purposes.\n\n    -ValuesHeader \u003cObject\u003e\n        Specifies the column name to search for unique values mapped to the row identifiers.\n        ColumnMapper will take any value found in the first column and create new columns\n        for each unique value found in this one. Defaults to '[PO]GL Account (GL Account Id)'\n        for legacy purposes.\n\n    -OutputPath \u003cObject\u003e\n        Specifies the path to write the output CSV file to.\n        Defaults to ColumnMap_YYYYMMDD.csv\n\n    -Open [\u003cSwitchParameter\u003e]\n        Opens the output CSV file.\n        Defaults to false.\n\n### Getting Help\n\nAs with most functions and cmdlets, you can use the `Get-Help` cmdlet. To see help for `Invoke-ColumnMapper`, run:\n\n```powershell\nGet-Help Invoke-ColumnMapper\n```\n\n## Example\n\nLet's say you have the file **People.csv**:\n\n| Names | FavoriteSport |\n|-------|---------------|\n| Bob   | Basketball    |\n| Bob   | Baseball      |\n| Alice | Basketball    |\n| Alice | Tennis        |\n| Alice | Volleyball    |\n| Alice | Volleyball    |\n\nPass the file to `Invoke-ColumnMapper` and specify the **Names** and **FavoriteSport** columns, and you'll get a new CSV file that looks like this:\n\n| Names | FavoriteSport |          |            |\n|-------|---------------|----------|------------|\n| Bob   | Basketball    | Baseball |            |\n| Alice | Basketball    | Tennis   | Volleyball |\n\nThe invocation in PowerShell would look like this:\n\n```powershell\nPS C:\\Users\\americanhanko\u003e Import-Module Invoke-ColumnMapper\nPS C:\\Users\\americanhanko\u003e Invoke-ColumnMapper -Path .\\People.csv -KeysHeader Names -ValuesHeader FavoriteSport\nOutput file is here: C:\\Users\\americanhanko\\ColumnMap_20190416.csv\n```\n\n## Detailed Explanation\n\n`Invoke-ColumnMapper` finds all unique values in the column specified by the `KeysHeader` parameter and converts them to hash keys. When it finds a new key,\nit asks for any values found in the column specified by the `ValuesHeader` parameter and adds them to a new array. It continues to add any new values\nfound in the `ValuesHeader` column to each corresponding array. Finally, we split the array into a comma-separated string so that it can be imported\neasily into your favorite spreadsheet application.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famericanhanko%2Fcolumnmapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famericanhanko%2Fcolumnmapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famericanhanko%2Fcolumnmapper/lists"}