{"id":13937325,"url":"https://github.com/klen/atmark","last_synced_at":"2025-07-06T01:37:47.212Z","repository":{"id":57412400,"uuid":"21019503","full_name":"klen/atmark","owner":"klen","description":"Awk+Sed for humans","archived":false,"fork":false,"pushed_at":"2014-07-10T14:25:31.000Z","size":407,"stargazers_count":69,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-05-09T18:34:51.155Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klen.png","metadata":{"files":{"readme":"README.rst","changelog":"Changelog","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-19T23:55:33.000Z","updated_at":"2021-10-31T22:24:30.000Z","dependencies_parsed_at":"2022-09-26T17:11:12.363Z","dependency_job_id":null,"html_url":"https://github.com/klen/atmark","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fatmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fatmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fatmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fatmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klen","download_url":"https://codeload.github.com/klen/atmark/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fatmark/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259072696,"owners_count":22801069,"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-08-07T23:03:30.356Z","updated_at":"2025-06-17T10:13:04.235Z","avatar_url":"https://github.com/klen.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"The Atmark\n##########\n\n.. _description:\n\nThe Atmark -- Awk+sed for humans.\n\nDo this: ::\n\n    # Rename a files in current directory (file-name -\u003e file_name.jpg)\n    $ ls | @ sub - _ \"mv # @.jpg\" | sh\n\nExcept this: ::\n\n    # Rename a files in current directory (file-name -\u003e file_name.jpg)\n    $ ls | awk '{print $1 $1}' | sed s/\"-\"/\"_\"/ | awk '{print \"mv\", $2, $1, \".jpg\"}' | sh\n\n\nMore deep: ::\n\n    $ ls | @  sub  -  _  \"mv # @.jpg\" | sh\n              ---  |  |  ------------\n               |   |  |      \\_ format string (# - link on first state,\n               |   |  |                        @ - link on current state (after replace))\n               |   |  |\n               |   |   \\_ second replace param (to replace)\n               |   |\n               |    \\_ first replace param (what replace)\n               |\n                \\_ function name (substitute)\n\nMore examples:\n\nChange file's extension .html \u003e .php ::\n\n    # Atmark\n    $ ls | @ split . head \"mv # @.php\"\n\n    # Awk/Sed\n    $ ls | awk '{printf \"mv \"$0; sub(/html/,\"php\"); print \" \"$0}' | sh\n\n\nPrint all but the first three columns ::\n\n    # Atmark (\\t means tab)\n    $ ls -la | @ split_ drop 3 join \\t\n\n    # Awk/Sed\n    $ ls -la | awk '{for(i=1;i\u003c4;i++) $i=\"\";print}'\n\n\nKill process by name ::\n\n    # Atmark\n    $ ps aux | @ grep sysmond$ index 2 \"kill @\" | sh \n\n    # Awk/Sed\n    $ ps aux | grep [s]ysmond | awk '{print \"kill \"$2}' | sh\n\n\nAnd more, more, more.\n\n.. _badges:\n\n.. image:: https://secure.travis-ci.org/klen/atmark.png?branch=develop\n    :target: http://travis-ci.org/klen/atmark\n    :alt: Build Status\n\n.. image:: https://coveralls.io/repos/klen/atmark/badge.png?branch=develop\n    :target: https://coveralls.io/r/klen/atmark?branch=develop\n\n.. image:: https://pypip.in/d/atmark/badge.png\n    :target: https://pypi.python.org/pypi/atmark\n\n.. image:: https://badge.fury.io/py/atmark.png\n    :target: http://badge.fury.io/py/atmark\n\n.. _documentation:\n\n**Docs are available at https://atmark.readthedocs.org/. Pull requests\nwith documentation enhancements and/or fixes are awesome and most welcome.**\n\n.. _contents:\n\n.. contents::\n\n.. _requirements:\n\nRequirements\n=============\n\n- python \u003e= 2.6\n\n.. _installation:\n\nInstallation\n=============\n\n**The Atmark** should be installed using pip: ::\n\n    pip install atmark\n\n\nBash completion\n---------------\n\nAtmark supports bash completion. Just add this lines to your `.bashrc`: ::\n\n    _atmark_complete() {\n        COMPREPLY=( $( COMP_WORDS=\"${COMP_WORDS[*]}\" \\\\\n                    COMP_CWORD=$COMP_CWORD \\\\\n                    _ATMARK_COMPLETE=complete $1 ) )\n        return 0\n    }\n\n    complete -F _atmark_complete -o default @ @@;\n\nYou can easy do it with command: ::\n\n    @ -bs \u003e\u003e ~/.bashrc\n\n.. _usage:\n\nUsage\n=====\n\nGet help\n--------\n\n::\n\n    $ @ -h\n\n    Atmark (@) -- is a command line utility for parsing text input and generating output.\n\n    You can pipe data within a Atmark (@) statement using standard unix style pipes (\"|\").\n    Provide for Atmark function composition and let them work for you.\n\n    Example. Replace \"_\" with \"-\" in files in current dir and change the files extensions to jpg:\n\n        $ ls | @ replace _ -  split . \"mv # @.jpg\"\n\n    It is mean:\n\n        $ ls \u003e replace($LINE, \"_\", \"-\") \u003e split($RESULT, \".\") \u003e format($RESULT, \"mv $LINE $RESULT.jpg\")\n\n    You can use \"@ --debug ARGS\" for debug Armark commands.\n\n    ===================================================================================\n    LIST OF THE BUILT IN FUNCTIONS\n\n\n    format FORMAT_STRING \t -- format and print a string.\n\n        Symbol '@' in FORMAT_STRING represents the current value in process of composition of fuctions.\n        Symbol '#' in FORMAT_STRING represents the history state.\n            Where   # or #0 -- first state, #\u003cn\u003e (#1, #2) -- state with number n\n\n        Synonyms: You can drop `format` function name. This lines are equalent:\n\n            $ ls | @ upper format \"@.BAK\"\n            $ ls | @ upper \"@.BAK\"\n\n    capitalize/cap \t -- capitalize the string.\n\n    drop N \t\t -- drop N elements from list/string.\n\n    equal/== PATTERN \t -- return None if arg is not equal to PATTERN.\n\n    filter/if \t\t -- filter results by value has length\n\n    head/h \t\t -- extract the first element/character of a list/string\n\n    index/ix N \t         -- get the N-th element/character from list/string.\n\n    join/j SEPARATOR \t -- concatenate a list/string with intervening occurrences of SEPARATOR\n\n    join_/j_ \t\t -- same as join but SEPARATOR set as ' '\n\n    kill REGEXP \t -- replace in a string/list REGEXP to ''.\n\n    last \t\t -- get last element/character of incoming list/string.\n\n    length/len \t\t -- return length of list/string.\n\n    lower/l \t\t -- make the string is lowercase\n\n    map FUNCTION \t -- apply the following function to each element/character in list/string.\n\n    nocolor/nc \t\t -- Remove ansi colors from string.\n\n    notequal/!= PATTERN  -- return None if arg is equal to PATTERN.\n\n    notgrep/ng REGEXP \t -- filter results by REGEXP. Leave ungrepped\n\n    replace/r/sub FROM TO -- replace in a string/list FROM to TO.\n\n    reverse/rev \t -- reverse list/string.\n\n    rstrip/rs/rtrim PATTERN -- return the string with trailing PATTERN removed.\n\n    grep/g REGEXP \t -- filter results by REGEXP\n\n    sort \t\t -- sort list/string.\n\n    split/sp SEPARATOR \t -- return a list of the substrings of the string splited by SEPARATOR\n\n    split_/sp_ \t\t -- same as split by splited a string by whitespace characters\n\n    strip/s/trim PATTERN -- return the string with leading and trailing PATTERN removed.\n\n    strip_/s_/trim_ \t -- same as strip but trims a whitespaces.\n\n    tail/t \t\t -- extract the elements after the head of a list\n\n    take N \t\t -- take N elements from list/string.\n\n    upper/u \t\t -- make the string is uppercase.\n\n\n.. _bugtracker:\n\nBug tracker\n===========\n\nIf you have any suggestions, bug reports or\nannoyances please report them to the issue tracker\nat https://github.com/klen/atmark/issues\n\n.. _contributing:\n\nContributing\n============\n\nDevelopment of starter happens at github: https://github.com/klen/atmark\n\n\nContributors\n=============\n\n* klen_ (Kirill Klenov)\n\n.. _license:\n\nLicense\n========\n\nLicensed under a `BSD license`_.\n\n.. _links:\n\n.. _BSD license: http://www.linfo.org/bsdlicense.html\n.. _klen: http://klen.github.com/\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fatmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklen%2Fatmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fatmark/lists"}