The Autopackage API |
| Table of Contents / Public library / Text file and manipulation |
Easy-to-use functions to get info about or to manipulate text files.
| addSectionLine | <FILENAME> <SECTION> <REPLACE> <MATCH> |
| getSection | <INIFILE> <SECTION> |
| removeSectionLine | <INIFILE> <SECTION> <MATCH> |
| removeLine | <FILENAME> <STRING> |
| endsWithNewLine | <FILENAME> |
| addSectionLine | ||||||||
| Syntax: addSectionLine <FILENAME> <SECTION> <REPLACE> <MATCH> | ||||||||
| ||||||||
| Add or replace a text line to a named section of an INI-style file. Filename or section marker will be added if either is not present if NATCH is not given the REPLACE text will be added |
| getSection | ||||
| Syntax: getSection <INIFILE> <SECTION> | ||||
| ||||
| Extracts the contents of an INI file section. |
| removeSectionLine | ||||||
| Syntax: removeSectionLine <INIFILE> <SECTION> <MATCH> | ||||||
| ||||||
| Remove a text line to a named section of a INI file. | ||||||
Example:
# hello.ini contains: # [Foo] # hello=1 # world=2 removeSectionLine "hello.ini" "Foo" "hello=1" # Now it contains: # [Foo] # world=2 |
| removeLine | ||||
| Syntax: removeLine <FILENAME> <STRING> | ||||
| ||||
| Look for lines that equals STRING in a text file and removes them. |
| endsWithNewLine | ||||
| Syntax: endsWithNewLine <FILENAME> | ||||
| ||||
| Finds out if the last byte in file FILENAME is a newline (\n). |