ZTree.com  | ZEN  | About...  

 Index   Back

[Discuss] INI file management from command line?   [Discuss]

By: Art Kocsis     So Calif  
Date: Aug 31,2017 at 08:29
In Response to: [Discuss] INI file management from command line? (Paul Laufer)

> I found myself with a project this AM where a program I support had
> duplicate [Sections] in several INI files. There were many INI files
> involved, and the dupes were in just some of them.
>
> It dawned on me that I'm sure there's a decent Win32 utility out
> there that would have made this much easier than (V)iewing each file,
> (S)earching for the "[Section]" I'm concerned about, and seeing if it
> shows up more than once.
>
Not exactly what you wanted but this may help. It extracts all the section headers and outputs a sorted list. Just copy and save the code to a cmd file and run it with the names of your ini files. The output file is annotated with the run date and source file name. At least it would make scanning for dups much easier.


<<<<<<<<<<<<<<<<<<<<<<<<<< Code start >>>>>>>>>>>>>>>>>>>>>>>>>

:: Command file to extract and sort ini file section titles

Set bgn=%date:~-2,2%-%date:~0,2%-%date:~3,2% %time:~0,2%:%time:~3,2%
Set bgn=%bgn: = 0%
Echo Date Time: %bgn% > "%~n1.xtr"
Echo Ini Source: %1 >> "%~n1.xtr"
Echo Ini Sections: >> "%~n1.xtr"
Echo ================ >> "%~n1.xtr"

Findstr /b /c:[ "%1" | Sort >> "%~n1.xtr" 2>&1

<<<<<<<<<<<<<<<<<<<<<<<<<< Code End >>>>>>>>>>>>>>>>>>>>>>>>>


Namaste', Art

Press any key to exit,
Press any other key to continue...
- unknown

281 views      
Thread locked
 

Messages in this Thread

 
94,426 Postings in 11,918 Threads, 348 registered users, 6 users online (0 registered, 6 guests)
Index | Admin contact |   Forum Time: Sep 20, 2019 - 6:18 pm EDT  |  Hits:28,653,099  (1,541 Today )
RSS Feed