我需要输入数字的文件
https://github.com/eggham0518/helpme/blob/master/yukim_720.sql
我把它从1到84。
我所做的一次尝试
public class main {
public static void main(String[] args) throws IOException {
String fileName = "C:/Users/kang/Downloads/yukim.txt";
List<String> newLines = new ArrayList<>();
for (String line : Files.readAllLines(Paths.get(fileName), StandardCharsets.ISO_8859_1)) {
if (line.contains("INSERT INTO yukim_720 VALUES ( '")) {
newLines.add(line.replace("INSERT INTO yukim_720 VALUES ( '", "INSERT INTO yukim_720 VALUES ( '"+ "'" +i++));
} else {
newLines.add(line);
}
}
Files.write(Paths.get(fileName), newLines, StandardCharsets.ISO_8859_1);
}
}
慕盖茨4494581
相关分类