Group json string by key and add to array - javascript
I've been at this for a while now and can't seem to get this. I am also relatively new to javascript. My goal is to create an array (or new javascript object) that has the format
{
data:{
[A1:"first column first row", B1:"second column", C1:"third column",...etc],
[A2:"first column first row", B2:"second column", C2:"third column",...etc],
[A3:"first column first row", B3:"second column", C3:"third column",...etc],
[A4:"first column first row", B4:"second column", C4:"third column",...etc],
[A5:"first column first row", B5:"second column", C5:"third column",...etc]
}
}
which could be closely related to how excel is formatted with rows and columns. I plan to use this to then feed handsontable for the client side manipulation of this data.
What I currently have is
var file = __dirname + '/../../clientFiles/exceltest.json';
fs.readFile(file, 'utf8', function (err, data) {
if (err) {
sails.log.error('ERROR: ' + err);
return;
}
data = JSON.parse(data);
var rows = Object.keys(data);
rows.forEach(function(column) {
var items = Object.keys(data[column]);
items.sort();
items.forEach(function(item) {
var value = data[column][item];
console.log(item+' = '+value);
});
});
});
The key names will never be less than 2 characters, but can grow in size (e.g A1 => AAA1) just like in excel.
The web page script is
<div id="dataTable"></div>
<script>
$("#dataTable").handsontable({
data: <%= data %>,
startRows: 6,
startCols: 8,
rowHeaders: true,
colHeaders: true,
});
</script>
the json I am pullng is formatted like
{
"sheet1": {
"F15": "4,385.97",
"G15": "910.36",
"H15": "1,555.36",
"I15": "373.74",
"J15": "24.03%",
"K15": "58.53%",
"L15": "61",
"M15": "669",
"N15": "216665",
"B16": "01/14/2014",
"D16": "829",
"E16": "12,997.13",
"F16": "531.85",
"G16": "225.48",
"H16": "359.21",
"I16": "80.21",
"J16": "22.33%",
"K16": "62.77%",
"L16": "55",
"M16": "99",
"N16": "45384",
"B17": "01/14/2014",
"D17": "320",
"E17": "6,142.45",
"F17": "1,643.42",
"G17": "129.76",
"H17": "215.90",
"I17": "41.09",
"J17": "19.03%",
"K17": "60.10%",
"L17": "111",
"M17": "182",
"N17": "35485",
"D18": "13478",
"E18": "94,735.05",
"F18": "6,663.08",
"G18": "1,689.97",
"H18": "3,054.92",
"I18": "839.16",
"J18": "27.47%",
"K18": "55.32%",
"L18": "29",
"M18": "996",
"N18": "396396"
},
"sheet2": {
"F15": "4,385.97",
"G15": "910.36",
"H15": "1,555.36",
"I15": "373.74",
"J15": "24.03%",
"K15": "58.53%",
"L15": "61",
"M15": "669",
"N15": "216665",
"B16": "01/14/2014",
"D16": "829",
"E16": "12,997.13",
"F16": "531.85",
"G16": "225.48",
"H16": "359.21",
"I16": "80.21",
"J16": "22.33%",
"K16": "62.77%",
"L16": "55",
"M16": "99",
"N16": "45384",
"B17": "01/14/2014",
"D17": "320",
"E17": "6,142.45",
"F17": "1,643.42",
"G17": "129.76",
"H17": "215.90",
"I17": "41.09",
"J17": "19.03%",
"K17": "60.10%",
"L17": "111",
"M17": "182",
"N17": "35485",
"D18": "13478",
"E18": "94,735.05",
"F18": "6,663.08",
"G18": "1,689.97",
"H18": "3,054.92",
"I18": "839.16",
"J18": "27.47%",
"K18": "55.32%",
"L18": "29",
"M18": "996",
"N18": "396396"
}
}
I am using sails and nodejs for my framework and engine. I have been able to sort the keys, but grouping them eludes me. I can make use of underscorejs if need be.
Thanks in advance.
The following will code will format your JSON appropriately, but I'm not sure if you wanted all the sheets combined into one.
Update: Using the format you provided, the JSON will not work with handsontable. I've updated my solution to the correct format and included the integration code for handsontable.
Update 2: Included column definitions so the table paints correctly.
Live Demo
JS
var sheets = {
"sheet1": {
"F15": "4,385.97",
"G15": "910.36",
"H15": "1,555.36",
"I15": "373.74",
"J15": "24.03%",
"K15": "58.53%",
"L15": "61",
"M15": "669",
"N15": "216665",
"B16": "01/14/2014",
"D16": "829",
"E16": "12,997.13",
"F16": "531.85",
"G16": "225.48",
"H16": "359.21",
"I16": "80.21",
"J16": "22.33%",
"K16": "62.77%",
"L16": "55",
"M16": "99",
"N16": "45384",
"B17": "01/14/2014",
"D17": "320",
"E17": "6,142.45",
"F17": "1,643.42",
"G17": "129.76",
"H17": "215.90",
"I17": "41.09",
"J17": "19.03%",
"K17": "60.10%",
"L17": "111",
"M17": "182",
"N17": "35485",
"D18": "13478",
"E18": "94,735.05",
"F18": "6,663.08",
"G18": "1,689.97",
"H18": "3,054.92",
"I18": "839.16",
"J18": "27.47%",
"K18": "55.32%",
"L18": "29",
"M18": "996",
"N18": "396396"
},
"sheet2": {
"F15": "4,385.97",
"G15": "910.36",
"H15": "1,555.36",
"I15": "373.74",
"J15": "24.03%",
"K15": "58.53%",
"L15": "61",
"M15": "669",
"N15": "216665",
"B16": "01/14/2014",
"D16": "829",
"E16": "12,997.13",
"F16": "531.85",
"G16": "225.48",
"H16": "359.21",
"I16": "80.21",
"J16": "22.33%",
"K16": "62.77%",
"L16": "55",
"M16": "99",
"N16": "45384",
"B17": "01/14/2014",
"D17": "320",
"E17": "6,142.45",
"F17": "1,643.42",
"G17": "129.76",
"H17": "215.90",
"I17": "41.09",
"J17": "19.03%",
"K17": "60.10%",
"L17": "111",
"M17": "182",
"N17": "35485",
"D18": "13478",
"E18": "94,735.05",
"F18": "6,663.08",
"G18": "1,689.97",
"H18": "3,054.92",
"I18": "839.16",
"J18": "27.47%",
"K18": "55.32%",
"L18": "29",
"M18": "996",
"N18": "396396"
}
};
function processJSON(sheets){
var data = [];
for(var sheet in sheets){
var curSheet = sheets[sheet];
var rowData = {};
var curRowNum = -1;
var nextRowNum;
for(var cell in curSheet){
nextRowNum = parseInt(cell.replace( /^\D+/g, ''),10);
cellLetter = cell.replace(/[0-9]/g, '');
if(nextRowNum !== curRowNum){
debugger;
rowData = {};
data.push(rowData);
curRowNum = nextRowNum;
}
rowData[cellLetter] = curSheet[cell];
}
}
return data;
}
var data = processJSON(sheets);
console.log(data);
$('#example').handsontable({
data: data,
minSpareRows:0,
colHeaders: true,
contextMenu: true,
columns: [
{data: "A"},
{data: "B"},
{data: "C"},
{data: "D"},
{data: "E"},
{data: "F"},
{data: "G"},
{data: "H"},
{data: "I"},
{data: "J"},
{data: "K"},
{data: "L"},
{data: "M"},
{data: "N"},
{data: "O"},
{data: "P"},
{data: "Q"},
{data: "R"},
{data: "S"}
]
});
function bindDumpButton() {
$('body').on('click', 'button[name=dump]', function () {
var dump = $(this).data('dump');
var $container = $(dump);
console.log('data of ' + dump, $container.handsontable('getData'));
});
}
bindDumpButton();
Results
[
{
"F": "4,385.97",
"G": "910.36",
"H": "1,555.36",
"I": "373.74",
"J": "24.03%",
"K": "58.53%",
"L": "61",
"M": "669",
"N": "216665"
},
{
"B": "01/14/2014",
"D": "829",
"E": "12,997.13",
"F": "531.85",
"G": "225.48",
"H": "359.21",
"I": "80.21",
"J": "22.33%",
"K": "62.77%",
"L": "55",
"M": "99",
"N": "45384"
},
{
"B": "01/14/2014",
"D": "320",
"E": "6,142.45",
"F": "1,643.42",
"G": "129.76",
"H": "215.90",
"I": "41.09",
"J": "19.03%",
"K": "60.10%",
"L": "111",
"M": "182",
"N": "35485"
},
{
"D": "13478",
"E": "94,735.05",
"F": "6,663.08",
"G": "1,689.97",
"H": "3,054.92",
"I": "839.16",
"J": "27.47%",
"K": "55.32%",
"L": "29",
"M": "996",
"N": "396396"
},
{
"F": "4,385.97",
"G": "910.36",
"H": "1,555.36",
"I": "373.74",
"J": "24.03%",
"K": "58.53%",
"L": "61",
"M": "669",
"N": "216665"
},
{
"B": "01/14/2014",
"D": "829",
"E": "12,997.13",
"F": "531.85",
"G": "225.48",
"H": "359.21",
"I": "80.21",
"J": "22.33%",
"K": "62.77%",
"L": "55",
"M": "99",
"N": "45384"
},
{
"B": "01/14/2014",
"D": "320",
"E": "6,142.45",
"F": "1,643.42",
"G": "129.76",
"H": "215.90",
"I": "41.09",
"J": "19.03%",
"K": "60.10%",
"L": "111",
"M": "182",
"N": "35485"
},
{
"D": "13478",
"E": "94,735.05",
"F": "6,663.08",
"G": "1,689.97",
"H": "3,054.92",
"I": "839.16",
"J": "27.47%",
"K": "55.32%",
"L": "29",
"M": "996",
"N": "396396"
}
]
Related
Object Child Key Path
I want to iterate through nested Object and I want to store the all the child keys path as separate array { "A": { "C": { "G": {} } }, "B": { "D": { "G": {} }, "E": { "H": {} }, "F": { "I": { "H": {} }, "J": {} } } } I need Array in below format. A,C,G B,D,G B,E,H B,F,J B,F,I,H
You can use recursion with Object.entries to get the values. Here is an example. const data = { "A": { "C": { "G": {} } }, "B": { "D": { "G": {} }, "E": { "H": {} }, "F": { "I": { "H": {} }, "J": {} } } }; const result = [] function getPaths(data,path=''){ const list = Object.entries(data) if(!list.length){ result.push(path) return } list.forEach(([key,value])=>getPaths(value,path ? path+','+key : key)) } getPaths(data) console.log(result)
Normalise JSON object key names
I am wanting to write a function to turn a JSON object's keys into more appropriate names. As you can see by the JSON object below, the keys are 1 letter and are not very readable or useful for anyone. Therefore I would like to loop through the object (or something similar) and rename all the keys, and then return this JSON. { "e": "56049", "pp": "371861", "c": "GAME", "x": 2, "st": "2017-04-27T15:01:29Z", "o": 0, "r": true, "u": "2017-04-27T15:01:29Z", "t": "p", "i": "371871", "z": 1493305289586 }
You can reduce object keys to new object, e.g.: const obj = { "e": "56049", "pp": "371861", "c": "GAME", "x": 2, "st": "2017-04-27T15:01:29Z", "o": 0, "r": true, "u": "2017-04-27T15:01:29Z", "t": "p", "i": "371871", "z": 1493305289586 } // [key] -> [normalized name] mapping const names = { "e": "e-name", "pp": "pp-name", "c": "c-name", "x": "x-name", "st": "st-name", "o": "o-name", "r": "r-name", "u": "u-name", "t": "t-name", "i": "i-name", "z": "z-name" } const renamedProps = Object.keys(obj).reduce((renamed, key) => { renamed[names[key]] = obj[key]; return renamed; }, {});
var obj = { "e": "56049", "pp": "371861", "c": "GAME", "x": 2 }, names = ["e_new-name", "pp_new-name", "c_new-name", "x_new-name"], updated = {}, keys = Object.keys(obj); for (i = 0; i < keys.length; i++) { updated[names[i]] = obj[keys[i]]; } console.log(JSON.stringify(updated)); // will print // {"e_new-name":"56049","pp_new-name":"371861","c_new-name":"GAME","x_new-name":2} jsfiddle
Parsing JSON - Javascript - Undefined
Here is my JSON: [ { "0": "324", "1": "Cavill ", "2": "11", "3": "100018463", "4": "RAR", "5": "DummyX", "6": "DummyY", "7": "Moretext", "8": "moretext", "id": "lol", "teacher": "Specsavers ", "rate": "11", "teacherid": "100018463", "address": "114 Road X", "postcode": "WXER 21", "lat": "51.511871", "lon": "-0.112934", "distance": "0.023308985382378217" } ] This is held in a variable called "hold". I am trying to output "teacher" in a div called output1. Here is my code: obj = JSON.parse(hold); document.getElementById("output1").innerHTML = obj[1].teacher; I keep getting undefined. I tried changing 1 to 0. Same issue - undefined. What am I doing wrong here? How do I access attribute data from each node/branch?
Index starts from 0 and in your data index 1 is undefined. obj = JSON.parse(hold); document.getElementById("output1").innerHTML = obj[0].teacher; //------------------------------------------------^^^------
Make sure hold is actually a JSON string. And the way you are accessing the parsed json is wrong, it should be 0 since there's only one json string. var hold = '[ { "0": "324","1": "Cavill ","2": "11", "3": "100018463", "4": "RAR", "5": "DummyX","6": "DummyY","7": "Moretext", "8": "moretext","id": "lol","teacher": "Specsavers ", "rate": "11","teacherid": "100018463", "address": "114 Road X", "postcode": "WXER 21","lat": "51.511871","lon": "-0.112934", "distance": "0.023308985382378217" }]'; var obj = JSON.parse(hold); document.getElementById('output1').innerHTML = obj[0].teacher; <div id="output1"></div>
Array index starts from 0. So in your parsed json, obj[0] represents the first element. As there is no second element obj[1] will be undefined. Use obj[0] instead obj[1]. Working Code: var hold = '[{ "0": "324", "1": "Cavill ", "2": "11", "3": "100018463", "4": "RAR", "5": "DummyX", "6": "DummyY", "7": "Moretext", "8": "moretext", "id": "lol", "teacher": "Specsavers ", "rate": "11", "teacherid": "100018463", "address": "114 Road X", "postcode": "WXER 21", "lat": "51.511871", "lon": "-0.112934", "distance": "0.023308985382378217"}]'; var obj = JSON.parse(hold); document.getElementById("output1").innerHTML = obj[0].teacher; <div id="output1"></div>
How to iterate over a json object list?
i am struggling how to sum all the values of "B" in my json object. I want the console log to show me the grand total of all the "B" values. var voltot = 0; $.each(json,function(k,v){ voltot = v.B += voltot ; //console.log(v.B); }); console.log(voltot); HERE IS MY FULL JSON OBJECT. var json= [ { "a": "OOCBER", "b": "OOCL BERLIN", "c": "CHINA", "d": "GREAT BRITAIN", "e": "*PI", "f": "NGB", "g": "CN", "i": "GB", "n": 9, "o": 6, "p": "2015-09-14", "q": "2015-09-14", "s": 4, "u": "40HC", "v": "TRLU7564566", "w": "CN0794909", "x": "LEIGH", "y": "NINGBO", "z": 395, "B": 68.8, "C": 7987.5, }, { "a": "OOCBER", "b": "OOCL BERLIN", "c": "CHINA", "d": "GREAT BRITAIN", "e": "*PI", "f": "NGB", "g": "CN", "i": "GB", "n": 9, "o": 6, "p": "2015-09-14", "q": "2015-09-14", "s": 4, "u": "40HC", "v": "TCLU8306124", "w": "CN0786008", "x": "OXFORDSHIRE", "y": "NINGBO", "z": 412, "B": 68, "C": 8790.5, } ] i am struggling how to sum all the values of "B" in my json object. I want the console log to show me the grand total of all the "B" values. var voltot = 0; $.each(json,function(k,v){ voltot = v.B += voltot ; //console.log(v.B); }); console.log(voltot);
This is wrong voltot = v.B += voltot ; Make like this voltot += v.B; Or voltot = v.B + voltot ;
The preferred method to obtain an unique value from an array is the Array.prototype.reduce method, which takes a callback function and a starting value (it reduces an array to a single value). You could use it this way : json.reduce(function(total, current) { return typeof current.B === "number" ? total + current.B : total; }, 0); Here is a JSFiddle.
Here's JSFiddle. I just shrunk json and post. Try with full json array var json= [ { "z": 395, "B": 68, "C": 7987.5, }, { "z": 395, "B": 68, "C": 7987.5, } ]; var voltot = 0; $.each(json,function(k,v){ voltot += v.B; }); console.log(voltot);
The operator += is incorrect. #RiccardoC answer was correct. Also, you don't need to use jquery to sum the values. You could simply do the following var voltot=0; json.forEach(function(element) {voltot+=element.B}) The forEach function will run a callback for each element of your array
My JSON loads in Safari but not in chrome
I have a json with data. You can check it online on http://misterwolfs.be/keyboard/. My json loads normally in safari but in chrome it won't get my data! Dus anyone knows if there is something wrong with my json or if chrome is harder to get than safari? This is how I try to get my json data : $.get('resources/json/data.json', function(json) { console.log('json', json); keyboardController.keys = json.keyboard; }, 'json' ).success(function () { console.log('test success'); }); And this is my json file { "keyboard" : { "esc": [{"Monday":80,"Tuesday":35,"Wednesday":63,"Thursday":51,"Friday":129,"Saturday":55,"Sunday":108,"Total":521}], "f1": [{"Monday":6,"Tuesday":9,"Wednesday":18,"Thursday":4,"Friday":3,"Saturday":7,"Sunday":6,"Total":53}], "f2": [{"Monday":9,"Tuesday":3,"Wednesday":5,"Thursday":18,"Friday":6,"Saturday":19,"Sunday":7,"Total":67}], "f3": [{"Monday":2,"Tuesday":10,"Wednesday":9,"Thursday":3,"Friday":1,"Saturday":3,"Sunday":4,"Total":32}], "f4": [{"Monday":9,"Tuesday":5,"Wednesday":3,"Thursday":7,"Friday":15,"Saturday":5,"Sunday":8,"Total":52}], "f5": [{"Monday":3,"Tuesday":9,"Wednesday":6,"Thursday":4,"Friday":9,"Saturday":1,"Sunday":4,"Total":36}], "f6": [{"Monday":5,"Tuesday":19,"Wednesday":9,"Thursday":3,"Friday":7,"Saturday":8,"Sunday":3,"Total":54}], "f7": [{"Monday":8,"Tuesday":3,"Wednesday":4,"Thursday":9,"Friday":18,"Saturday":12,"Sunday":3,"Total":57}], "f8": [{"Monday":3,"Tuesday":5,"Wednesday":7,"Thursday":14,"Friday":3,"Saturday":4,"Sunday":2,"Total":38}], "f9": [{"Monday":8,"Tuesday":7,"Wednesday":14,"Thursday":4,"Friday":9,"Saturday":9,"Sunday":1,"Total":52}], "f10": [{"Monday":3,"Tuesday":9,"Wednesday":4,"Thursday":6,"Friday":3,"Saturday":5,"Sunday":2,"Total":32}], "f12": [{"Monday":6,"Tuesday":2,"Wednesday":2,"Thursday":9,"Friday":4,"Saturday":7,"Sunday":16,"Total":46}], "f13": [{"Monday":9,"Tuesday":12,"Wednesday":6,"Thursday":17,"Friday":8,"Saturday":14,"Sunday":15,"Total":81}], "#": [{"Monday":6,"Tuesday":10,"Wednesday":6,"Thursday":2,"Friday":12,"Saturday":7,"Sunday":30,"Total":73}], "1": [{"Monday":204,"Tuesday":60,"Wednesday":89,"Thursday":52,"Friday":138,"Saturday":99,"Sunday":137,"Total":779}], "2": [{"Monday":59,"Tuesday":22,"Wednesday":32,"Thursday":29,"Friday":89,"Saturday":92,"Sunday":97,"Total":419}], "3": [{"Monday":44,"Tuesday":78,"Wednesday":60,"Thursday":35,"Friday":108,"Saturday":68,"Sunday":101,"Total":494}], "4": [{"Monday":145,"Tuesday":156,"Wednesday":139,"Thursday":72,"Friday":40,"Saturday":58,"Sunday":117,"Total":727}], "5": [{"Monday":248,"Tuesday":191,"Wednesday":188,"Thursday":90,"Friday":112,"Saturday":109,"Sunday":122,"Total":1060}], "6": [{"Monday":28,"Tuesday":13,"Wednesday":31,"Thursday":15,"Friday":84,"Saturday":15,"Sunday":28,"Total":214}], "7": [{"Monday":26,"Tuesday":29,"Wednesday":23,"Thursday":12,"Friday":59,"Saturday":17,"Sunday":22,"Total":188}], "8": [{"Monday":31,"Tuesday":15,"Wednesday":26,"Thursday":28,"Friday":43,"Saturday":46,"Sunday":54,"Total":243}], "9": [{"Monday":37,"Tuesday":23,"Wednesday":14,"Thursday":15,"Friday":30,"Saturday":50,"Sunday":138,"Total":165}], "0": [{"Monday":94,"Tuesday":101,"Wednesday":99,"Thursday":87,"Friday":59,"Saturday":112,"Sunday":76,"Total":690}], "°": [{"Monday":124,"Tuesday":105,"Wednesday":91,"Thursday":53,"Friday":32,"Saturday":40,"Sunday":88,"Total":521}], "_": [{"Monday":105,"Tuesday":53,"Wednesday":60,"Thursday":91,"Friday":85,"Saturday":53,"Sunday":39,"Total":535}], "del": [{"Monday":1474,"Tuesday":1639,"Wednesday":1311,"Thursday":875,"Friday":1911,"Saturday":997,"Sunday":1536,"Total":9743}], "tab": [{"Monday":1189,"Tuesday":1773,"Wednesday":1379,"Thursday":834,"Friday":1632,"Saturday":989,"Sunday":1511,"Total":9307}], "A": [{"Monday":880,"Tuesday":754,"Wednesday":520,"Thursday":290,"Friday":432,"Saturday":420,"Sunday":892,"Total":4188}], "Z": [{"Monday":230,"Tuesday":271,"Wednesday":234,"Thursday":428,"Friday":829,"Saturday":204,"Sunday":236,"Total":2432}], "E": [{"Monday":1370,"Tuesday":919,"Wednesday":670,"Thursday":411,"Friday":219,"Saturday":651,"Sunday":1144,"Total":5384}], "R": [{"Monday":674,"Tuesday":790,"Wednesday":646,"Thursday":563,"Friday":438,"Saturday":687,"Sunday":1056,"Total":4854}], "T": [{"Monday":728,"Tuesday":459,"Wednesday":323,"Thursday":206,"Friday":684,"Saturday":188,"Sunday":602,"Total":3190}], "Y": [{"Monday":76,"Tuesday":201,"Wednesday":159,"Thursday":44,"Friday":58,"Saturday":48,"Sunday":142,"Total":728}], "U": [{"Monday":236,"Tuesday":171,"Wednesday":114,"Thursday":76,"Friday":430,"Saturday":70,"Sunday":220,"Total":1317}], "I": [{"Monday":561,"Tuesday":396,"Wednesday":257,"Thursday":196,"Friday":819,"Saturday":271,"Sunday":499,"Total":2999}], "O": [{"Monday":763,"Tuesday":443,"Wednesday":353,"Thursday":221,"Friday":439,"Saturday":313,"Sunday":479,"Total":3011}], "P": [{"Monday":305,"Tuesday":179,"Wednesday":122,"Thursday":106,"Friday":289,"Saturday":175,"Sunday":211,"Total":1387}], "¨": [{"Monday":19,"Tuesday":8,"Wednesday":8,"Thursday":17,"Friday":34,"Saturday":3,"Sunday":7,"Total":96}], "*": [{"Monday":20,"Tuesday":70,"Wednesday":30,"Thursday":17,"Friday":49,"Saturday":4,"Sunday":22,"Total":182}], "caps": [{"Monday":49,"Tuesday":1,"Wednesday":39,"Thursday":2,"Friday":20,"Saturday":29,"Sunday":12,"Total":74}], "Q": [{"Monday":55,"Tuesday":28,"Wednesday":654,"Thursday":24,"Friday":239,"Saturday":16,"Sunday":48,"Total":1064}], "S": [{"Monday":717,"Tuesday":827,"Wednesday":411,"Thursday":487,"Friday":1012,"Saturday":506,"Sunday":864,"Total":4824}], "D": [{"Monday":477,"Tuesday":499,"Wednesday":100,"Thursday":363,"Friday":232,"Saturday":260,"Sunday":507,"Total":2438}], "F": [{"Monday":150,"Tuesday":150,"Wednesday":165,"Thursday":66,"Friday":101,"Saturday":54,"Sunday":212,"Total":898}], "G": [{"Monday":270,"Tuesday":152,"Wednesday":115,"Thursday":89,"Friday":310,"Saturday":142,"Sunday":189,"Total":1267}], "H": [{"Monday":359,"Tuesday":176,"Wednesday":50,"Thursday":105,"Friday":213,"Saturday":112,"Sunday":188,"Total":1203}], "J": [{"Monday":131,"Tuesday":133,"Wednesday":195,"Thursday":48,"Friday":80,"Saturday":59,"Sunday":95,"Total":741}], "K": [{"Monday":217,"Tuesday":215,"Wednesday":218,"Thursday":84,"Friday":128,"Saturday":137,"Sunday":201,"Total":1200}], "L": [{"Monday":382,"Tuesday":261,"Wednesday":118,"Thursday":114,"Friday":248,"Saturday":140,"Sunday":341,"Total":1604}], "M": [{"Monday":312,"Tuesday":158,"Wednesday":13,"Thursday":96,"Friday":213,"Saturday":151,"Sunday":249,"Total":1192}], "%": [{"Monday":6,"Tuesday":10,"Wednesday":27,"Thursday":3,"Friday":23,"Saturday":1,"Sunday":13,"Total":83}], "£": [{"Monday":5,"Tuesday":1,"Wednesday":12,"Thursday":3,"Friday":8,"Saturday":1,"Sunday":4,"Total":22}], "enter": [{"Monday":1200,"Tuesday":878,"Wednesday":988,"Thursday":419,"Friday":1532,"Saturday":480,"Sunday":1015,"Total":6512}], ">": [{"Monday":62,"Tuesday":210,"Wednesday":185,"Thursday":114,"Friday":109,"Saturday":143,"Sunday":50,"Total":873}], "W": [{"Monday":324,"Tuesday":75,"Wednesday":68,"Thursday":73,"Friday":265,"Saturday":66,"Sunday":370,"Total":1241}], "X": [{"Monday":109,"Tuesday":264,"Wednesday":292,"Thursday":142,"Friday":89,"Saturday":134,"Sunday":137,"Total":1167}], "C": [{"Monday":342,"Tuesday":367,"Wednesday":343,"Thursday":137,"Friday":263,"Saturday":195,"Sunday":286,"Total":1933}], "V": [{"Monday":295,"Tuesday":121,"Wednesday":86,"Thursday":52,"Friday":238,"Saturday":71,"Sunday":275,"Total":1138}], "B": [{"Monday":225,"Tuesday":454,"Wednesday":284,"Thursday":211,"Friday":382,"Saturday":376,"Sunday":191,"Total":2123}], "N": [{"Monday":690,"Tuesday":102,"Wednesday":79,"Thursday":27,"Friday":373,"Saturday":90,"Sunday":524,"Total":1885}], "?": [{"Monday":146,"Tuesday":268,"Wednesday":222,"Thursday":131,"Friday":200,"Saturday":27,"Sunday":49,"Total":1043}], ".": [{"Monday":264,"Tuesday":164,"Wednesday":145,"Thursday":83,"Friday":219,"Saturday":115,"Sunday":220,"Total":1210}], "/": [{"Monday":173,"Tuesday":47,"Wednesday":79,"Thursday":79,"Friday":120,"Saturday":22,"Sunday":182,"Total":692}], "+": [{"Monday":90,"Tuesday":64,"Wednesday":51,"Thursday":53,"Friday":43,"Saturday":29,"Sunday":36,"Total":366}], "shift": [{"Monday":1197,"Tuesday":741,"Wednesday":760,"Thursday":421,"Friday":998,"Saturday":630,"Sunday":939,"Total":5686}], "fn": [{"Monday":89,"Tuesday":60,"Wednesday":49,"Thursday":86,"Friday":100,"Saturday":32,"Sunday":84,"Total":500}], "ctrl": [{"Monday":37,"Tuesday":10,"Wednesday":7,"Thursday":24,"Friday":30,"Saturday":27,"Sunday":70,"Total":205}], "space": [{"Monday":1556,"Tuesday":3988,"Wednesday":692,"Thursday":541,"Friday":1932,"Saturday":970,"Sunday":1112,"Total":10791}], "cmd": [{"Monday":1122,"Tuesday":1724,"Wednesday":1254,"Thursday":826,"Friday":1349,"Saturday":767,"Sunday":1478,"Total":8523}], "alt": [{"Monday":96,"Tuesday":150,"Wednesday":97,"Thursday":28,"Friday":128,"Saturday":39,"Sunday":55,"Total":593}], "left": [{"Monday":332,"Tuesday":1026,"Wednesday":307,"Thursday":229,"Friday":754,"Saturday":227,"Sunday":480,"Total":3355}], "down": [{"Monday":394,"Tuesday":1438,"Wednesday":442,"Thursday":314,"Friday":912,"Saturday":226,"Sunday":432,"Total":4258}], "right": [{"Monday":326,"Tuesday":1580,"Wednesday":436,"Thursday":194,"Friday":832,"Saturday":298,"Sunday":454,"Total":4120}], "up": [{"Monday":207,"Tuesday":734,"Wednesday":205,"Thursday":114,"Friday":349,"Saturday":130,"Sunday":165,"Total":1904}] } }