文本文件如下:
现在不好处理,打算将其转换为excel,其中通过冒号分割:line.split(":")
main方法如下:
public static void main(String[] args) {
String textFilePath = "D:\\zoom\\期刊\\J_Medline\\J_Medline"; // 替换为你的文本文件路径
String excelFilePath = "D:\\zoom\\期刊\\J_Medline\\output1.xlsx"; // 生成的 Excel 文件路径
List<String[]> data = new ArrayList<>();
try (BufferedReader br = new BufferedReader(new FileReader(textFilePath))) {
String line;
while ((line = br.readLine()) != null) {
String[] fields = line.split(