{
    "content": [
        {
            "type": "text",
            "text": "# tr (perldoc)\n\n## TLDR\n\n> Translate characters: run replacements based on single characters and character sets.\n\n- Replace all occurrences of a character in a file, and print the result:\n  `tr < {{path/to/file}} {{find_character}} {{replace_character}}`\n- Replace all occurrences of a character from another command's output:\n  `echo {{text}} | tr {{find_character}} {{replace_character}}`\n- Map each character of the first set to the corresponding character of the second set:\n  `tr < {{path/to/file}} '{{abcd}}' '{{jkmn}}'`\n- Delete all occurrences of the specified set of characters from the input:\n  `tr < {{path/to/file}} {{-d|--delete}} '{{input_characters}}'`\n- Compress a series of identical characters to a single character:\n  `tr < {{path/to/file}} {{-s|--squeeze-repeats}} '{{input_characters}}'`\n- Translate the contents of a file to upper-case:\n  `tr < {{path/to/file}} \"[:lower:]\" \"[:upper:]\"`\n- Strip out non-printable characters from a file:\n  `tr < {{path/to/file}} {{-cd|--complement --delete}} \"[:print:]\"`\n\n*Source: tldr-pages*\n\n---\n\n## Full Content\n\n"
        }
    ],
    "structuredContent": {
        "command": "tr",
        "section": "-f",
        "mode": "perldoc",
        "summary": null,
        "synopsis": null,
        "tldr_summary": "Translate characters: run replacements based on single characters and character sets.",
        "tldr_examples": [
            {
                "description": "Replace all occurrences of a character in a file, and print the result",
                "command": "tr < {{path/to/file}} {{find_character}} {{replace_character}}"
            },
            {
                "description": "Replace all occurrences of a character from another command's output",
                "command": "echo {{text}} | tr {{find_character}} {{replace_character}}"
            },
            {
                "description": "Map each character of the first set to the corresponding character of the second set",
                "command": "tr < {{path/to/file}} '{{abcd}}' '{{jkmn}}'"
            },
            {
                "description": "Delete all occurrences of the specified set of characters from the input",
                "command": "tr < {{path/to/file}} {{-d|--delete}} '{{input_characters}}'"
            },
            {
                "description": "Compress a series of identical characters to a single character",
                "command": "tr < {{path/to/file}} {{-s|--squeeze-repeats}} '{{input_characters}}'"
            },
            {
                "description": "Translate the contents of a file to upper-case",
                "command": "tr < {{path/to/file}} \"[:lower:]\" \"[:upper:]\""
            },
            {
                "description": "Strip out non-printable characters from a file",
                "command": "tr < {{path/to/file}} {{-cd|--complement --delete}} \"[:print:]\""
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [],
        "sections": []
    }
}