• Announcement: Lua.org now officially recommends this forum as a meeting place for the Lua community

Read table with sutable (1 Viewer)

Fellerson

Newcomer
Joined
Jul 4, 2021
Messages
1
Reaction score
0
hi Dear

i'm trying to read a file. The database is like this :

local AUCTIONATOR_PRICE_DATABASE = {
["Pierre de lune azur"] = {
["H3884"] = 8600,
["mr"] = 8600,
},
["Recette : Basilic noirci"] = {
["H3884"] = 104424,
["mr"] = 104424,
},
["Echarpe aborigène de l'aigle"] = {
["H3884"] = 49212,
["mr"] = 49212,
},
["Baguette majestueuse de la chouette"] = {
["H3884"] = 80000,
["mr"] = 80000,
},
}

i'm trying to have a result in a table, for an export CSV, like the screenshot attached

the idea is to divide / 10000 the mr and h3884 columns during the operation.

i've started with

local AUCTIONATOR_PRICE_DATABASE = {
["Pierre de lune azur"] = {
["H3884"] = 8600,
["mr"] = 8600,
},
["Recette : Basilic noirci"] = {
["H3884"] = 104424,
["mr"] = 104424,
},
["Echarpe aborigène de l'aigle"] = {
["H3884"] = 49212,
["mr"] = 49212,
},
["Baguette majestueuse de la chouette"] = {
["H3884"] = 80000,
["mr"] = 80000,
},
}

print("Hello world")


for index, data in ipairs(AUCTIONATOR_PRICE_DATABASE) do
print(index)

for key, value in pairs(data) do
print('\t', key, value)
end
end

but sadly, it prints only my Helloworld

thanks
 

Attachments

  • screenresult.png
    screenresult.png
    3.8 KB · Views: 1
Top