Key-Value file reader.
This is a simple key-value structure file parser, which can be used for various purposes, such as configuration files, do whatever you want.
For Unity, download package from here.
For Dll, download from here.
The typical K-V file is as follows:
// Comment line1
// Comment line2
// Comment line3
KEY VALUE1
KEY1 VALUE2
This tiny library can parse almost any file :
Open KV Reader
Tool by clicking Tools/KV Reader
// Reader Parse
Reader reader = new Reader();
// Parse
reader.ParseFromString(File.text);
// Print
Console.WriteLine(reader["KEY"][0]);
string test = @"
// Comment
KEY1 VALUE1
KEY2 VALUE2
";
// Parse
var data = Reader.ParseDocumentFromString(test, out List<string> headComments);
// Read
Console.WriteLine(data[1].Key + " " + data[1].Value);
// Change Value
data[1].Key = "KEY_CHANGE";
data[1].Value = "VALUE_CHANGE";
// Format
var result = Reader.FormatDocumentToString(data, headComments);
// Print Result
Console.WriteLine(result);