public static int splitByLine(File sourceFile, File targetDir,int rows) {
		int ret=0;
		if (!sourceFile.exists() || rows <= 0 || sourceFile.isDirectory()) {
			System.out.println("源文件不存在或者输入了错误的行数");
			return -1;
		}
		if (targetDir.exists()) {
			if (!targetDir.isDirectory()) {
				System.out.println("目标文件夹错误,不是一个文件夹");
				return -1;
			}
		} else {
			targetDir.mkdirs();
		}
		try {
			BufferedReader br = new BufferedReader(new FileReader(sourceFile));
			BufferedWriter bw = null;
			String str = "";
			String tempData = br.readLine();
			int i = 1;
			while (tempData != null) {
				str += tempData + "\r\n";
				if (i % rows == 0) {
					bw = new BufferedWriter(new FileWriter(new File(
							targetDir.getAbsolutePath() + "/" + ret + "_"
									+ sourceFile.getName())));
					bw.write(str);
					bw.close();
					str = "";
					ret += 1;
				}
				i++;
				tempData = br.readLine();
			}
			if ((i - 1) % rows != 0) {
				bw = new BufferedWriter(new FileWriter(new File(
						targetDir.getAbsolutePath() + "/" + ret + "_"
								+ sourceFile.getName())));
				bw.write(str);
				bw.close();
				br.close();
				ret += 1;
			}
			System.out.println("文件分割结束,共分割成了" + ret + "个文件");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return ret;
	}