Run it
Copy the script and paste it into your executor.
(tbl, saveToFile, forcedPrint, tblName)
maxLines =
tblName = tblName
buffer = {}
(tbl, prefix)
(tbl) ~=
.(buffer, { = , text = .. (tbl)})
prefix = prefix
numValueKeys, otherValueKeys, tableKeys = {}, {}, {}
k, v (tbl)
(v) ==
.(tableKeys, k)
(k) ==
.(numValueKeys, k)
.(otherValueKeys, k)
.(numValueKeys)
.(otherValueKeys)
.(tableKeys, (a, b) (a) < (b) )
sortedKeys = {}
_, k (numValueKeys) .(sortedKeys, k)
_, k (otherValueKeys) .(sortedKeys, k)
_, k (tableKeys) .(sortedKeys, k)
i, key (sortedKeys)
value = tbl[key]
isLast = (i == #sortedKeys)
isTable = (value) ==
branch = isTable
line = prefix .. branch .. .. (key) ..
isTable
line = prefix .. branch .. (key)
.(buffer, { = , text = line})
newPrefix = prefix .. (isLast )
(value, newPrefix)
formattedLine = .(, line, (value), (value))
.(buffer, { = , text = formattedLine})
.()
t = .()
( .. tblName .. )
(tbl, prefix )
(, .() - t, )
()
(, tblName)
_, entry (buffer)
entry.type ==
(entry.text)
(entry.text)
.()
()
#buffer > maxLines saveToFile
makefolder isfile writefile
content = {}
_, entry (buffer)
.(content, entry.text)
extension =
counter =
fileName = .(, tblName)
()
( .. fileName)
counter = counter +
fileName = .(, tblName, counter, extension)
filename = fileName
( .. filename, .(content, ))
forcedPrint
()
( .. #buffer .. .. filename)
()
.()
()
tbl = {
[] = ,
[] = ,
[] = ,
[] = {
[] = ,
[] = {
[] = ,
[] = ,
},
[] = ,
[] = ,
},
[] = ,
[] = ,
[] = ,
[] = ,
}
(tbl, , , )Created By Quren (Discord: fuckyougitler) - Allows saving results to a text file for large tables - Recursively prints table contents to the console - Sorts keys: numeric in ascending order, then non-numeric alphabetically, tables last - Formats output as a tree with prefixes (┃, └──, ╲) - Displays key, value, and data type for non-table values - Supports nested tables with indentation for clarity

Universal