if((firstChar == '"') && 
if(field.length === 2 && field == "\"\""){ listOfFields[j] = ""; }else if((firstChar == '"') && 
	_getArrayOfArraysFromCsvFileContents: function(/* string */ csvFileContents){		/* summary:		 *   Parses a string of CSV records into a nested array structure.		 * description:		 *   Given a string containing CSV records, this method parses		 *   the string and returns a data structure containing the parsed		 *   content.  The data structure we return is an array of length		 *   R, where R is the number of rows (lines) in the CSV data.  The 		 *   return array contains one sub-array for each CSV line, and each 		 *   sub-array contains C string values, where C is the number of 		 *   columns in the CSV data.		 */		 		/* example:		 *   For example, given this CSV string as input:		 *     "Title, Year, Producer \n Alien, 1979, Ridley Scott \n Blade Runner, 1982, Ridley Scott"		 *   this._dataArray will be set to:		 *     [["Alien", "1979", "Ridley Scott"],		 *      ["Blade Runner", "1982", "Ridley Scott"]]		 *   And this._attributes will be set to:		 *     ["Title", "Year", "Producer"]		 *   And this._attributeIndexes will be set to:		 *     { "Title":0, "Year":1, "Producer":2 }		 */		if(dojo.isString(csvFileContents)){			var lineEndingCharacters = new RegExp("\r\n|\n|\r");			var leadingWhiteSpaceCharacters = new RegExp("^\\s+",'g');			var trailingWhiteSpaceCharacters = new RegExp("\\s+$",'g');			var doubleQuotes = new RegExp('""','g');			var arrayOfOutputRecords = [];						var arrayOfInputLines = csvFileContents.split(lineEndingCharacters);			for(var i = 0; i < arrayOfInputLines.length; ++i){				var singleLine = arrayOfInputLines[i];				if(singleLine.length > 0){					var listOfFields = singleLine.split(',');					var j = 0;					while(j < listOfFields.length){						var space_field_space = listOfFields[j];						var field_space = space_field_space.replace(leadingWhiteSpaceCharacters, ''); // trim leading whitespace						var field = field_space.replace(trailingWhiteSpaceCharacters, ''); // trim trailing whitespace						var firstChar = field.charAt(0);						var lastChar = field.charAt(field.length - 1);						var secondToLastChar = field.charAt(field.length - 2);						var thirdToLastChar = field.charAt(field.length - 3);						if((firstChar == '"') && 								((lastChar != '"') || 								 ((lastChar == '"') && (secondToLastChar == '"') && (thirdToLastChar != '"')))){							if(j+1 === listOfFields.length){								// alert("The last field in record " + i + " is corrupted:\n" + field);								return null; //null							}							var nextField = listOfFields[j+1];							listOfFields[j] = field_space + ',' + nextField;							listOfFields.splice(j+1, 1); // delete element [j+1] from the list						}else{							if((firstChar == '"') && (lastChar == '"')){								field = field.slice(1, (field.length - 1)); // trim the " characters off the ends								field = field.replace(doubleQuotes, '"');   // replace "" with "							}							listOfFields[j] = field;							j += 1;						}					}					arrayOfOutputRecords.push(listOfFields);				}			}						// The first item of the array must be the header row with attribute names.			this._attributes = arrayOfOutputRecords.shift();			for(var i=0; i<this._attributes.length; i++){				// Store the index of each attribute 				this._attributeIndexes[this._attributes[i]] = i;			}			this._dataArray = arrayOfOutputRecords; //Array		}	},
5168	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5168/31317f3d9ffdaa44f58fbdc81d23b385ea1cabe2/CsvStore.js/buggy/data/CsvStore.js