Quick Tip - Restricting to sections of a .INI file

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

Quick Tip - Restricting to sections of a .INI file

Post by DataMystic Support » Thu Sep 09, 2004 10:34 am

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, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest