Quick Tip - Restricting to sections of a .INI file

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
User avatar
DataMystic Support
Site Admin
Posts: 2229
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia

Quick Tip - Restricting to sections of a .INI file

Post by DataMystic Support »

You can restrict a replacement or set of changes to a single section of a .INI file. The trick is to use a search/replace as the restriction. The example below converts a .INI file section starting with [TmainForm] to lowercase. This can be easily changed to perform a search/replace, or to remove matching lines, or to add new lines with an Add Footer filter.

Code: Select all

EasyPattern [[ mustBeginWith( '[TmainForm]', cr, lf, ),  1+ char,  mustEndWith( cr, lf, '[' ) ]] with [$0]
|  [ ] Match case
|  [ ] Whole words only
|  [ ] Case sensitive replace
|  [X] Prompt on replace
|  [ ] Skip prompt if identical
|  [ ] First only
|  [ ] Extract matches
|  Maximum text buffer size 4096
+--Convert to lowercase
If the .INI file section will be longer than 4Kbytes, increase the maximum text buffer size to suit.

Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Post Reply