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

					int errorcode=0;// print error code in the final output file;
					int errornum=2; // feature number
					String result="",mac="";

					
					File downloadfile_r = new File(downloadpath+"\\mac.txt");
					File outputfile = new File(filepath);	

					try {
						String line="";
						ArrayList<String> content_r = new ArrayList<String>();
						if (!downloadfile_r.exists()){
							throw new mac_exception(0);
						}
						
						BufferedReader br_r = new BufferedReader(new FileReader(downloadfile_r));
						
						while ((line=br_r.readLine())!=null){
							content_r.add(line);
						}
						
						br_r.close();					
						downloadfile_r.delete();
						
						if (content_r.size()<1){
							throw new mac_exception(2);
						}
						
						String []addr = content_r.get(0).split(":");
						for (int i = 0; i<addr.length;i++){
							mac+=addr[i];
						}	
						
						result="PASS";
						
					} catch (IOException e) {
						result = "FAILED";
						errorcode = 0;
					}
					catch (mac_exception ex){
						result = "FAILED";
						errorcode = ex.errorcode;
					}
					
					
					try {
						BufferedWriter bw = new BufferedWriter(new FileWriter(outputfile,true));
						bw.write("MAC_Address="+mac+"\r\n");
						bw.write("MAC_Read_Result="+result+"\r\n");
						System.out.println("MAC_Address="+mac);
						System.out.println("MAC_Read_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;
				}