Context: I have a list with the structure below. It can contain a variable number of items, in multiples of 3. I am trying to transform each set of 3 into a separate JSON document.
['SCAN1.txt', 'Lastmodified:20191125.121049', 'Filesize:7196', 'SCAN2.txt', 'Lastmodified:20191125.121017', 'Filesize:3949', 'SCAN3.txt', 'Lastmodified:20191125.121056', 'Filesize:2766']
Question: How can I convert the single list into a JSON document with the following form, while also allowing for variability in the number of files it can accomadate:
{
{
"File": {
"File_Name":"SCAN1.txt",
"Last_Modified":"20191125.121049",
"File_Size":"7196"
}
{
"File": {
"File_Name":"SCAN2.txt",
"Last_Modified":"20191125.121017",
"File_Size":"3949"
}
}
{
"File": {
"File_Name":"SCAN3.txt",
"Last_Modified":"20191125.121056",
"File_Size":"2766"
}
}
}