public void LogParse(String file) {
		
		log.info("start parse " + file);
		
		try {
	        FileInputStream fis		= new FileInputStream(file);
	        InputStreamReader isr	= new InputStreamReader(fis, "gbk");
	        BufferedReader br		= new BufferedReader(isr);
	        
	        String line	= "";
	        String[] arrs	= null;
	        
	        Pattern pattern_date = Pattern.compile("^\\d{8}$");
	        
	        int line_num = 0;
	        while ((line = br.readLine()) != null) {
	        	line_num++;
	        	
	        	//字段之间用空格分隔，但是空格个数不定，同时要避免股票名称中可能会出现的一个空格
	            arrs = line.split("\\s{2,}");
	            
	            Matcher matcher = pattern_date.matcher(arrs[0]);
	            if (! matcher.matches()) {
	            	log.error("date format error for line " + line_num + "! date:" + arrs[0]);
	            	continue;
	            }
	            
		        TransDetailRecord record = new TransDetailRecord();
	            
	            record.date = arrs[0];
	            record.code = arrs[1];
	            record.name = arrs[2];
	            record.deal_price	= Double.parseDouble(arrs[4]);
	            record.num			= Integer.parseInt(arrs[5]);
	            record.deal_amount	= Double.parseDouble(arrs[6]);
	            record.deal_total		= Double.parseDouble(arrs[7]); 
	            record.deal_fee_comm	= Double.parseDouble(arrs[8]);
	            record.deal_fee_tax		= Double.parseDouble(arrs[9]);
	            record.deal_fee_trans	= Double.parseDouble(arrs[10]);
	            record.deal_fee_other	= Double.parseDouble(arrs[11]);


	            //修正负数
	            if (arrs[3].equals(new String("买入"))) {
	            	record.opt	= TransDetailRecord.OPT_IN;
	            	record.deal_total	= -record.deal_total;
	            }
	            else if (arrs[3].equals(new String("卖出"))) {
	            	record.opt	= TransDetailRecord.OPT_OUT;
	            	record.num	= -record.num;
	            }
	            else {
	            	log.error("trans record opt error! file:" + file + ", line:" + line_num);
	            	continue;
	            }
	            
	            if (arrs[13].startsWith("A262235553")) {
	            	record.market	= TransDetailRecord.MARKET_SH;
	            }
	            else if (arrs[13].startsWith("0139116982")) {
	            	record.market	= TransDetailRecord.MARKET_SZ;
	            }
	            else {
	            	log.error("trans record market error! file:" + file + ", line:" + line_num);
	            	continue;
	            }
	            
	            //合并相同code和操作的记录
	            String keyowrd = record.code + "\005" + String.valueOf(record.opt);
	            if (true == record_map.containsKey(keyowrd)) {
	            	log.info("same trans need to merge! code:" + record.code + ", opt:" + record.opt);
	            	TransDetailRecord value = record_map.get(keyowrd);
	            	record = value.Merge(record);
	            }
	            record_map.put(keyowrd, record);
	        }
	        
	        br.close();
	        isr.close();
		} catch (Exception e) {
			log.error("file occur error! file:" + file, e);
			System.exit(0);
		} 
	}