skip to Main Content

Json – jq equivalent in python

cat * | jq '.cis[].properties.cloud_vm_display_name' | grep -v null "azuXXXXX" "azuXXXXX" "azuXXXXXX" "azuXXXXXX" Need to extract cloud VM name from multiple json files where the array number is different in every file. a = data1['cis'][0]['properties']['TenantsUses'][0] print(a) b = data1['cis'][]['properties']['cloud_vm_display_name'] File…

VIEW QUESTION

javascript reduce(),keys(), filter() method

While solving a problem to find missing numbers from an array. let arr = [15,3,5,6,7,2,1,8,12]; let findMissing = (arr)=>{ let res = arr.reduce((acc,n)=>{ acc[n]=1; return acc; },[]) return [...res.keys()].filter((i)=>{ if(res[i]!==1) return i }) } console.log(findMissing(arr)); output:[4, 9, 10, 11, 13,…

VIEW QUESTION
Back To Top
Search