{"id":13413939,"url":"https://github.com/Guitarbum722/align","last_synced_at":"2025-03-14T20:30:49.589Z","repository":{"id":47136495,"uuid":"89818347","full_name":"Guitarbum722/align","owner":"Guitarbum722","description":"A general purpose application and library for aligning text.","archived":false,"fork":false,"pushed_at":"2021-09-12T16:21:36.000Z","size":111,"stargazers_count":83,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-07-31T20:53:10.737Z","etag":null,"topics":["alignment","delimiter","formatter","golang","library","tool"],"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/Guitarbum722.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":"2017-04-29T23:22:22.000Z","updated_at":"2024-05-15T12:26:19.000Z","dependencies_parsed_at":"2022-09-06T04:50:38.026Z","dependency_job_id":null,"html_url":"https://github.com/Guitarbum722/align","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guitarbum722%2Falign","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guitarbum722%2Falign/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guitarbum722%2Falign/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guitarbum722%2Falign/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Guitarbum722","download_url":"https://codeload.github.com/Guitarbum722/align/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243642012,"owners_count":20323949,"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":["alignment","delimiter","formatter","golang","library","tool"],"created_at":"2024-07-30T20:01:53.200Z","updated_at":"2025-03-14T20:30:49.301Z","avatar_url":"https://github.com/Guitarbum722.png","language":"Go","readme":"# align\n_A general purpose application that aligns text_\n\n[![GoDoc](https://img.shields.io/badge/api-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/Guitarbum722/align) \n[![Build Status](https://travis-ci.org/Guitarbum722/align.svg?branch=master)](https://travis-ci.org/Guitarbum722/align)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Guitarbum722/align)](https://goreportcard.com/report/github.com/Guitarbum722/align)\n[![Coverage Status](https://coveralls.io/repos/github/Guitarbum722/align/badge.svg?branch=master)](https://coveralls.io/github/Guitarbum722/align?branch=master)\n\nThe focus of this application is to provide a fast, efficient, and useful tool for aligning text.\nIts creation is the result of inspiration from several other amazing alignment tools, namely [`column`](http://man7.org/linux/man-pages/man1/column.1.html) or the Sublime Text plugin [`AlignTab`](https://github.com/randy3k/AlignTab).\n\nSee the [Wiki](https://github.com/Guitarbum722/align/wiki) for usage examples!\n\n### Included\n\n* A simple yet useful CLI with options to specify your delimiter, input and output files, etc.\n* Align by any string as your delimiter or separator, not just a single character.\n* If your separator string is contained within the data itself, it can be escaped by specifying a text qualifier.\n* Right, Center, or Left justification of each field.\n\n_Why?_\n\nSometimes, it's just easier to align a CSV (or delimited file) by its delimiter and view the columns in your plain text editor (which saves you from opening Excel!).\n\nAnother use is to align blocks of code by `=` or `=\u003e`, etc.\n\n### Install\n\n```sh\n$ go get github.com/Guitarbum722/align\n$ make install\n\n$ # build all binaries\n$ make release\n```\n\n### Usage - CLI examples\n\n```\nUsage: align [-h] [-f] [-o] [-q] [-s] [-d] [-a] [-c] [-i] [-p]\nOptions:\n  -h | --help  help\n  -f           input file.  If not specified, pipe input to stdin\n  -o           output file. (default: stdout)\n  -q           text qualifier (if applicable)\n  -s           delimiter (default: ',')\n  -d           output delimiter (defaults to the value of sep)\n  -a           \u003cleft\u003e, \u003cright\u003e, \u003ccenter\u003e justification (default: left)\n  -c           output specific fields (default: all fields)\n  -i           override justification by column number (e.g. 2:center,5:right)\n  -p           extra padding surrounding delimiter\n```\n\n_Specify your input file, output file, delimiter._\n*You can also pipe input to stdin (if the `-f` option is provided, it will take precedence over Stdin)*\nIf no `-o` option is provided, stdout will be used.\n\n```sh\n$ align -f input_file.csv -o output_file.csv\n\n$ align -f input_file.csv -o \n\n$ cat awesome.csv | align\n```\n\nDo you have rows with a different number of fields?  This might be more common with code, but `align` doesn't care!\n\n```\n$ echo \"field1|field2\\nValue1|Value2\\nCoolValue1|CoolValue2|CoolValue3\" | align -s \\|\nfield1     | field2\nValue1     | Value2\nCoolValue1 | CoolValue2 | CoolValue3\n```\n\nColumn filtering (specifiy output fields and optionally override the justification of the output fields).  This might be useful if you would like to display a dollar amount or number field differently.  The specified fields are indexed at 1.\n\n```sh\n# output fields 1,3,5 justified 'right'\n$ cat file.csv | align -a right -c 1,3,5\n\n# output fields 1,2,3,7,8 with default justification (left) except for field 7, which is right justified\n$ cat file.csv | align -c 1,2,3,7,8 -i 1:right,7:center\n\n#output all fields by default, with right justification, with overridden justification on certain columns\n$ cat file.csv | align -a right -i 1:center,5:left\n```\n\nSupport for worldwide characters.\n```\nfirst          , last              , middle  , email\npaul           , danny             ,  かど    , や製油\n```\n\nIt is perfectly acceptable to even use emojis as your input/output delimiters.\n```\nfirst  😮 last     😮 email\nHector 😮 Gonzalez 😮 h.g@nothing.com\n```\n\nAdd additional padding if desired with the `-p` flag.  Default is 1 space, and 0 will output with no additional padding.  If the value supplied is less than 0, then the behavior will be as if it were set to 0 and no padding will be applied.\n```\n# padding of 4 spaces surrounding the delimiter.\nalign -p 4\n```\n\n### Contributions\n\nIf you have suggestions or discover a bug, please open an issue.  If you think you can make the fix, please use the Fork / Pull Request on your feature branch approach.\n","funding_links":[],"categories":["Text Processing","Go","文本处理","Bot Building","文本处理`解析和操作文本的代码库`","Specific Formats","Template Engines","\u003cspan id=\"文字处理-text-processing\"\u003e文字处理 Text Processing\u003c/span\u003e"],"sub_categories":["Advanced Console UIs","Formatters","查询语","格式器","HTTP Clients","交流","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGuitarbum722%2Falign","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGuitarbum722%2Falign","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGuitarbum722%2Falign/lists"}