ini-parser icon indicating copy to clipboard operation
ini-parser copied to clipboard

The problem of creating extra space

Open sami-soft opened this issue 5 years ago • 3 comments

There is a problem with saving if the contents of the file we are reading are as follows :

[Identification] NOM=1234 PRENOM=12

when editing and saving , it puts an empty space in the file before and after equal :

[Identification] NOM = 1234 PRENOM = 12

How to remove this space? To output the same as the first file?

sami-soft avatar Jul 12 '20 20:07 sami-soft

Download the source code and include it in your project. Then go to IniFileParser\Model\Configuration\IniParserConfiguration.cs open it in vs and edit AssigmentSpacer = " "; to AssigmentSpacer = "";

Mateo2197 avatar Oct 06 '20 06:10 Mateo2197

You can configure it when loading your .INI file. var parser = new FileIniDataParser(); IniData configData = parser.ReadFile(path); configData.Configuration.AssigmentSpacer = "";

thiagoaxll avatar Dec 23 '20 14:12 thiagoaxll

Glad there's a way around it but it would be nice if the default were for the library to maintain whatever it found in the file. I just lost 2 days to figuring out that I was essentially "corrupting" an INI file that is read by a space-intolerant tool.

Is there any comprehensive documentation of properties and so forth?

WFDexter avatar Mar 02 '22 18:03 WFDexter