private String csvEncode(String text)
	{
		if(text==null)
			return "null";
		String encoded="";
		boolean hasSpecialChar=false;
		int length=text.length();
		if (length>0) {
			for(int i=0;i<length;i++) {
				char ch=text.charAt(i);
				if(ch==',' || ch=='"') {
					hasSpecialChar=true;
					continue;
				}
			}
			
			if(hasSpecialChar) {
				encoded="\"";
				for(int i=0;i<length;i++) {
					char ch=text.charAt(i);
					if( ch=='"') 
						encoded+="\"";
					encoded+=ch;
				}
				encoded+="\"";
			}
			else 
				return text;
				
		}
		return encoded;
	}