Text Management
When working with text, it may be necessary to change the indentation level of a block. This code will take a multiline string and add or remove leading spaces to each line so that the indentation level of the block matches some absolute number of spaces.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Block Identation Level, Identation, Line, Multi, Multi Line Identation, Multiline String
License: Freeware | Download (60): Changing the indentation of a multi line string Download |
Smart pluralisation script has a function that provides more intelligence than simply adding an 's' to the end of a word.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Pluralisation, Spelling, Text, Text Management, Text Pluralisation, Text Tool
License: Freeware | Download (62): Smart pluralisation Download |
This script is a portable class to carry out all sorts of validation on strings. It uses regular expressions to carry out common validation procedures.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Regular, Regular Expressions, String, String Validator, Strings Validation Class, Validator
License: Freeware | Download (57): StringValidator Download |
When working between platforms, it is often necessary to convert the line endings on files for them to work, especially when it comes to code. Pass Unix Python code with and it goes nowhere. Same on Mac Python with . This code simply and easily fixes the problem.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Conversion, End Of Line Conversion, Endings, Line, Line Conversion, Line Endings
License: Freeware | Download (65): Change line endings Download |
This script go thru directory tree and looks for files of specified pattern, and then replace in those files a string with new one, overwriting old file without backups.
Platforms: Windows, Python,
Keyword: File, Replacement, String, String Management, String Replacement, Text Replace
License: Freeware | Download (58): Replace occurrence of string in files Download |
This class encapsulates a string with embedded variable names. They are usually evaluated when the object's __str__() method is called. You can specify that they be evaluated when the object is created by including the immediate argument to the constructor. The doc string at the top of the module...
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Objects, Print, Printing Strings, String Management, String Objects, Strings
License: Freeware | Download (64): Printing strings with embedded variable names Download |
This module contains a function that formats paragraphs of text to have a certain linewidth, optionally stretching lines to that width by filling word gaps with spaces. In other words, it does left-justified/word-wrapped and block formatted paragraphs.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Fill, Fill Paragraph, Formatted Paragraphs, Paragraph, Word, Word Wrap
License: Freeware | Download (60): Fill paragraph Download |
This script searches nested strings from a line of text. The strings are limited by two different characters.
Platforms: Python,
Keyword: Nested Strings, Search, Search Strings, Strings, Strings Management
License: Freeware | Download (59): Searching nested strings Download |
This script introduces a function to auto-strip indentation and whitespace from triple-quoted multi-line strings in Python code. Useful when you need to emit blocks of HTML/TCL/etc. from Python, but don't want to mess up the visual flow of your Python code.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Block, Code Visual Flow, Formatting, Html Block, String, String Block Formatting
License: Freeware | Download (64): Multi-line string block formatting Download |
This script allows you to reformat the clipboard text.
Platforms: Windows, Python,
Keyword: Clipboard, Clipboard Text, Formatting, Reformat Text, Text, Text Formatting
License: Freeware | Download (65): Reformatting clipboard text on win32 Download |
This function could be used to check if a string contains only ASCII characters.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Ascii, Ascii Encoding, Characters, Encoding, Encoding Guess, Encoding Tool
License: Freeware | Download (59): ASCII encoding guess Download |
This script defines a class you could use in place of a string and it emulates a string in all practical ways except that comparisons and lookups are case insensitive. All uses of the string for assignments, however, yield the original case.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Case, Case Insensitive, Insensitive, String Class, Strings, Strings Management
License: Freeware | Download (60): Case Insensitive Strings Download |
This script converts integers to binary strings with no leading zeros.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Binary, Binary String, Format, Format Integer, Integer, Integer To Binary
License: Freeware | Download (58): Format integer as binary string Download |
This script shows a simple (but not hopelessly fragile) approach for string substitution.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Processing, String, String Management, String Processing, String Substitution, Substitution
License: Freeware | Download (64): String substitution shorty Download |
This script sorts strings in a way that seems natural to humans. If the strings contain integers, then the integers are ordered numerically. For example, sorts ['Team 11', 'Team 3', 'Team 1'] into the order ['Team 1', 'Team 3', 'Team 11'].
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Numerical Order, Sorting, String, String Sorting, Text, Text Sorter
License: Freeware | Download (64): Natural string sorting Download |
This script is a very basic example of how to launch an editor from inside a program.
Platforms: Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Editor, Editor Launch, Launch, Text, Text Editor, Text Tool
License: Freeware | Download (58): Spawning an editor from a script Download |
This script extracts contents of all verbatim environments from the LaTeX file specified on command line. Modified LaTeX code with verbatiminput commands instead of verbatim is produced on the standard output.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Extract, Extract Text, Latex File Processing, Text Extraction, Texts, Verbatim
License: Freeware | Download (57): Extract verbatim texts from LaTeX file Download |
This script formats a number of columns of text into fixed widths. Each column may also be aligned independently. Whitespace is collapsed, though line breaks are retained (they may optionally be ignored).
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Format, Plain, Plain Text Format, Strings Formatting, Text, Text To Columns
License: Freeware | Download (59): Formatting plain text into columns Download |
This script shows a way to generate section numbers for a nested document structure. It can be used within a recursive algorithm to build a table of contents.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: Generate, Generate Section Numbers, Numbers, Section, Table Of Contents, Text Tool
License: Freeware | Download (60): Build section numbers for a table of contents Download |
This script replaces %(name)s style formatting with [name] style formatting. Custom open and close delimiters can be specified. Useful for templates exposed to end-users.
Platforms: Windows, Mac, *nix, Mac OSX, Linux, Python, BSD Solaris
Keyword: String, String Substitution, Style, Style Formatting, Substitution, Text Processing
License: Freeware | Download (57): Simplified string substitution Download |