0

i’m allowing myself to ask your help for a C# program. My goal is very simlpe : browse the file in example (in the bottom) and take the part “PRICE_DATABASE” in a CSV file.

Result should look like this Column A : Article → ART1 Column B : Prix → mr

each article (ART1, ART2 under “AH” have his price in “mr”

the file looks very close with JSON, but it’s not ! it’s LUA.

i've started with this link Easiest way to parse a Lua datastructure in C# / .Net

Thanks in advance !

many thanks in advance.

   PRICING_HISTORY = {
}
SHOPPING_LISTS = {
{
[“items”] = {
},
[“isRecents”] = 1,
[“name”] = “Recherches récentes”,
}, – [1]
}
PRICE_DATABASE = {
["__dbversion"] = 4,
[“AH”] = {
[“ART1”] = {
[“H3883”] = 1000000,
[“mr”] = 1000000,
},
[“ART2”] = {
[“H3883”] = 53000,
[“mr”] = 53000,
},
},
}

i'm able to make a Parse(File.ReadAllText(....path...)); of my file. The list "toks" is filled but i don't know how i can take the data in a table to go to CSV now (only the data from "SHOPPING_LIST". on my screenshot we can see ART1 ... and the price ... But i have al ot of shit like "]" "}" "=" and i don't know how to convert this in datable

enter image description here

EDIT : i've cleaned now some things but i've still some \ " in text and i don't know how to convert this list in a table

enter image description here

steve15
  • 131
  • 1
  • 1
  • 7

0 Answers0