public static boolean fileprocess(String downloadpath, String filepath, String []paras, String sn){

		int errorcode=0;// print error code in the final output file;
		int errornum = 13;
		String result="";

		File downloadfile = new File(downloadpath+"\\humid_test.txt");
		File outputfile = new File(filepath);
		

		double value =0;
		String line="";
		ArrayList <String> content = new ArrayList<String>();

		try {
			
			
			BufferedReader br = new BufferedReader(new FileReader(downloadfile));
			while ((line=br.readLine())!=null){
				content.add(line);
			}
			br.close();
			
			downloadfile.delete();

			double lower_bound=Double.parseDouble(paras[0]);			
			double upper_bound=Double.parseDouble(paras[1]);	
			
			if (content.size()!=1){
				result = "FAILED";
				errorcode=3;
			}
			else{
				value=Double.parseDouble(content.get(0));
				
				if (value>=lower_bound){
					if (value<=upper_bound){
						result="PASS";
					}
					else {
						result = "FAILED";
						errorcode =2;
					}
				}
				else{
					result = "FAILED";
					errorcode=1;
				}
			}
					
			

			

		} catch (IOException e) {
			e.printStackTrace();			
		}
			catch (NumberFormatException ex){
				result = "FAILED";
				errorcode = 0;
			}
		
		
		try {
			BufferedWriter bw = new BufferedWriter(new FileWriter(outputfile,true));
			bw.write("Humidity="+value+"\r\n");
			System.out.println("Humidity="+value);
			bw.write("Humidity_Result="+result+"\r\n");
			System.out.println("Humidity_Result="+result);
			if (result.equals("FAILED")){
				NumberFormat nf = NumberFormat.getIntegerInstance();
				nf.setMinimumIntegerDigits(2);
				bw.write("Error_Code= "+nf.format(errornum)+nf.format(errorcode)+"\r\n");
				System.out.println("Error_Code="+nf.format(errornum)+nf.format(errorcode));
			}
			bw.flush();
			bw.close();
		}catch (Exception e){
			e.printStackTrace();
		}

		return true;
	}