我已获取数据作为列表列表(内部列表由 2 个值组成,例如 (name,sam)),现在我想读取每个内部列表的数据并将第一个数据添加为键并将第二个数据添加为值财产清单。例如,((name,sam),(date,fourth),(age,twenty)) = 列表列表
转换为 = (name:"sam",date:"fourth",age:"twenty") = 属性列表
我怎样才能做到这一点?
set excelRead to WorkBook(ResourcePath(fileName))
set readColumns to excelRead.Worksheet(sheetName)
set listOfData to cellRange("A:B") of readColumns
put (:) into newPlist
repeat with each item of listOfData
put item 1 of it into key
put item 2 of it into Value
end repeat