Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How ignoring special characters like hash # at reading or common? #243

Open
Paderman opened this issue Nov 8, 2022 · 1 comment
Open

Comments

@Paderman
Copy link

Paderman commented Nov 8, 2022

How is it possible to ignore hash or other special characters at the beginning or common?

I have a non standard ini file that begins with a special character like # for comments, but with this character, I get an error message, without, it works.

Error message:
IniParser.Exceptions.ParsingException: 'Unknown file format. Couldn't parse the line: '#'. while parsing line number 0 with value '' - IniParser version: 2.5.2.0 while parsing line number 1 with value '#' - IniParser version: 2.5.2.0'

Thank you for your solution and helping 🙂

@Paderman Paderman changed the title How ignoring special characters like hash # at reading? How ignoring special characters like hash # at reading or common? Nov 8, 2022
@jacobussystems
Copy link

jacobussystems commented Nov 8, 2022

Well, you can use '#' for comments, e.g.

var parser = new FileIniDataParser();
parser.Parser.Configuration.CommentString = "#";

(That setting defaults to ';', by the way.)

Hope that helps,
Jim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants