public static String sample(String srcfile,int sampleN,int N) throws IOException{
		String output = srcfile.substring(0, srcfile.indexOf(".")) + "_sample.txt";
		File fout = new File(output);
		if (fout.exists()) {
			fout.delete();
		}

		ArrayList<Integer> trainIndices = new ArrayList<Integer>(sampleN);
		BootStrapSample(trainIndices,sampleN,N);//采样
		
		//生成训练数据--------
		Collections.sort(trainIndices);
		BufferedReader reader = new BufferedReader(new FileReader(srcfile));
		BufferedWriter writer = new BufferedWriter(new FileWriter(fout));
		
		int cusor = 0;
		String i_line;
		String last_line = null;
		for(int i=0;i<trainIndices.size();i++){
			if(i-1>=0 && (trainIndices.get(i) == trainIndices.get(i-1)||trainIndices.get(i)<cusor)){//与上次的相等
				i_line = last_line;
			}else{
				String[] retData = getData(reader,cusor,trainIndices.get(i)).split(":");
				i_line = retData[0];
				cusor = Integer.parseInt(retData[1]);
			}
			
			if(!"".equals(i_line) && i_line!=null && !"null".equals(i_line)){
				writer.write(/*trainIndices.get(i)+","+*/i_line+"\r\n");//
			}
			last_line = i_line;
		}
		reader.close();
		writer.close();
		//----------------------
		return output;
	}