Static Public Sub Hardware() As JSONCollection
Dim oTmp As JSONCollection
Dim oHwr As New JSONCollection
Dim vSub As Variant[]
Dim oSub As New JSONCollection
Dim sKey As String
Dim vrt As Variant
Dim v As Variant
Dim sSub As String
Dim s As String
Dim sRaw As String
Shell "inxi --output json --output-file print -bFSDxxx" To sRaw
oTmp = JSON.Decode(sRaw, True)
For Each vSub In oTmp
If InStr(oTmp.Key, "#") > 0 Then
sKey = Split(oTmp.Key, "#").Last
Else
sKey = oTmp.Key
Endif
oSub.Clear
s &= "\n"
s &= sKey & "\n"
s &= String(Len(sKey), "-") & "\n"
For Each vrt In vSub
If TypeOf(vrt) = 16 Then
For Each v In vrt
If InStr(vrt.Key, "#") > 0 Then
sSub = Split(vrt.Key, "#").Last
Else
sSub = vrt.Key
Endif
oSub.Add(v, sSub)
s &= sSub & ": " & v & "\n"
Next
Else
Endif
Next
oHwr.Add(oSub.Copy(), sKey)
Next
File.Save("/tmp/hw.txt", s)
Return oHwr
End
(21-09-2021, 08:24)Grandamakulo escribió: y resulta que lo tengo instalado. ¡Y yo sin saberlos, jajajaja!
(21-09-2021, 09:42)tincho escribió: Nota: hay un paquete adicional, que en Manjaro se llama perl-json-xs, que no suele venir instalado y que permite exportar los datos en formato xml y json.
Cita:Nota: hay un paquete adicional, que en Manjaro se llama perl-json-xs, que no suele venir instalado y que permite exportar los datos en formato xml y json.