{"id":16824917,"url":"https://github.com/tomnomnom/blocksort","last_synced_at":"2025-03-22T03:31:48.891Z","repository":{"id":61627168,"uuid":"545704725","full_name":"tomnomnom/blocksort","owner":"tomnomnom","description":"A tool for sorting blocks of lines","archived":false,"fork":false,"pushed_at":"2022-10-04T20:59:16.000Z","size":2,"stargazers_count":39,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-01T12:43:56.661Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomnomnom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-04T20:54:03.000Z","updated_at":"2025-02-18T19:29:38.000Z","dependencies_parsed_at":"2022-10-18T17:30:34.640Z","dependency_job_id":null,"html_url":"https://github.com/tomnomnom/blocksort","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fblocksort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fblocksort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fblocksort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fblocksort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomnomnom","download_url":"https://codeload.github.com/tomnomnom/blocksort/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244181377,"owners_count":20411601,"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":[],"created_at":"2024-10-13T11:12:25.191Z","updated_at":"2025-03-22T03:31:48.508Z","avatar_url":"https://github.com/tomnomnom.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blocksort\n\nA tool for sorting blocks of lines.\n\n## Install\n```\ngo install github.com/tomnomnom/blocksort@latest\n```\n\n## Usage\n\nGiven some blocks of lines on `stdin`:\n\n```\n▶ cat blocks.txt\nBlock C\n    Item 2\n    Item 1\nBlock A\n    Item 3\n    Item 2\nBlock B\n    Item 5\n    Item 3\n```\n\nThey can be sorted by a specific line (defaulting to the first line):\n\n```\n▶ cat blocks.txt | blocksort -n3\nBlock A\n    Item 3\n    Item 2\nBlock B\n    Item 5\n    Item 3\nBlock C\n    Item 2\n    Item 1\n```\n\nThe `-n`/`--number` flag sets how many lines are in each block.\nThe `-i`/`--index` flag sets which line in the block to use when sorting.\n\nGet help with `-h`:\n\n```\n▶ blocksort -h\nUsage of blocksort:\n  -i, --index int    Which line to sort by (0-indexed)\n  -n, --number int   Number of lines per block (default 3)\n  -r, --reverse      Reverse sort order\npflag: help requested\n```\n\n\n## Credit\nBuilt for [@digininja](https://github.com/digininja) as a result of\n[this Twitter thread](https://twitter.com/digininja/status/1577331330567766016).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomnomnom%2Fblocksort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomnomnom%2Fblocksort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomnomnom%2Fblocksort/lists"}