// *** The following code is copyright Tim Young (twy@shawbiz.ca) // The following two functions do the same thing: they take a string of CSV data // and return an array of arrays (the rows and columns). As produced by MS Excel, // the CSV data may include commas, double-quotes, and line-returns in each field // provided that the entire field is surrounded by double quotes, and all double // quotes must be doubled up to "". // This version is faster for Mozilla and Opera. function CVS2Array0(s){var r=[],c,b,x,n,f=0;s=s.replace(/""/g,'"');while(s.length){if(!f++)r[r.length]=[];n=1;if((c=s.charAt(x=0))=='"'){if((x=(s=s.substring(1)).indexOf('",'))!=-1)n=2;else x=s.lastIndexOf('"')}else{x=s.indexOf(',');if((c=s.indexOf('\n'))!=-1){if(c