|
|
@@ -15,24 +15,25 @@ public class PropertyValueSplit {
|
|
|
public static final int SINGLE_FILE_MAX_SIZE = 1000000;
|
|
|
|
|
|
// 器件和属性值两个文本文件的路径
|
|
|
- private static final String DATA_DIR = "C:\\Users\\sunyj-pc\\Desktop\\temp\\data\\test";
|
|
|
+ private static final String DATA_DIR = "C:\\Users\\sunyj-pc\\Desktop\\temp\\data\\prod";
|
|
|
|
|
|
// public static void main(String[] args) {
|
|
|
- // copy();
|
|
|
+ // // copy("PropertyValue", "copy");
|
|
|
+ // copy("Component", "copy2");
|
|
|
// }
|
|
|
|
|
|
- public static void copy() {
|
|
|
+ public static void copy(String src, String dest) {
|
|
|
BufferedReader bufferedReader = null;
|
|
|
PrintWriter printWriter = null;
|
|
|
// 分成多个文件存储
|
|
|
int fileIndex = 1;
|
|
|
try {
|
|
|
- File file = new File(DATA_DIR + "\\copy");
|
|
|
+ File file = new File(DATA_DIR + "\\" + dest);
|
|
|
if (!file.exists()) {
|
|
|
file.mkdirs();
|
|
|
}
|
|
|
- bufferedReader = new BufferedReader(new FileReader(DATA_DIR + "\\PropertyValue.txt"));
|
|
|
- printWriter = new PrintWriter(DATA_DIR + "\\copy\\pv_copy" + fileIndex + ".txt");
|
|
|
+ bufferedReader = new BufferedReader(new FileReader(DATA_DIR + "\\" + src + ".txt"));
|
|
|
+ printWriter = new PrintWriter(DATA_DIR + "\\" + dest + "\\" + src + fileIndex + ".txt");
|
|
|
String propertyValueLine = null;
|
|
|
int dataCount = 0;
|
|
|
while (!StringUtils.isEmpty(propertyValueLine = bufferedReader.readLine())) {
|
|
|
@@ -44,7 +45,7 @@ public class PropertyValueSplit {
|
|
|
printWriter.flush();
|
|
|
printWriter.close();
|
|
|
fileIndex++;
|
|
|
- printWriter = new PrintWriter(DATA_DIR + "\\copy\\pv_copy" + fileIndex + ".txt");
|
|
|
+ printWriter = new PrintWriter(DATA_DIR + "\\" + dest + "\\" + src + fileIndex + ".txt");
|
|
|
}
|
|
|
printWriter.write(propertyValueLine + "\n");
|
|
|
}
|