ZINC_code.js
/* Returns a pseudo-key map of a passed .xls file
 * Reads each line into an object as a new element, and the first column
 * is used as the key to link to the rest of the data/line text.
 * All entries are created as elements in a child array of the key. Thus,
 * all entries with an identical key are grouped in the same array.
 * @author csera
 * @param {String} parsedText Parsed, text database file to be used
 * @returns {Object} myKeyMap Generated key map of parsedText
 */
Returns a pseudo-key map of a passed .xls file
Reads each line into an object as a new element, and the first column
is used as the key to link to the rest of the data/line text.
All entries are created as elements in a child array of the key. Thus,
all entries with an identical key are grouped in the same array.
@author csera
@param {String} parsedText Parsed, text database file to be used
@returns {Object} myKeyMap Generated key map of parsedText
Returns a pseudo - key map of a passed . xls file Reads each line into an object as a new element and the first column is used as the key to link to the rest of the data / line text . All entries are created as elements in a child array of the key . Thus all entries with an identical key are grouped in the same array . @author csera @param { String } parsedText Parsed text database file to be used @returns { Object } myKeyMap Generated key map of parsedText
function makeKeyMap(parsedText){
   var myKeyMap = {};
   parsedText = parsedText.split('\n');
   for(line in parsedText){
      var lineData = parsedText[line].split('\t');
      if (!myKeyMap[lineData[0]]) {
         myKeyMap[lineData[0]] = [parsedText[line]];
      }
      else{
         myKeyMap[lineData[0]].push(parsedText[line]);
      }
   }
   console.log('Key map: '+myKeyMap);
   return myKeyMap;
}
function makeKeyMap ( parsedText ) { var myKeyMap = { } ; parsedText = parsedText . split ( '\n' ) ; for ( line in parsedText ) { var lineData = parsedText [ line ] . split ( '\t' ) ; if ( ! myKeyMap [ lineData [ 0 ] ] ) { myKeyMap [ lineData [ 0 ] ] = [ parsedText [ line ] ] ; } else { myKeyMap [ lineData [ 0 ] ] . push ( parsedText [ line ] ) ; } } console . log ( 'Key map: ' + myKeyMap ) ; return myKeyMap ; }
Returns a pseudo-key map of a passed .xls file
 Reads each line into an object as a new element, and the first column
 is used as the key to link to the rest of the data/line text.
Returns a pseudo - key map of a passed . xls file Reads each line into an object as a new element and the first column is used as the key to link to the rest of the data / line text .
//Create new child node if this value has not been added yet //(ie if the current ZINC ID has not yet been used) //If such a node already exists, instead push the data to a new, //terminal element of the child (of the ZINC ID key) array