**** Мой текстовый файл содержит данные:
Solar~Distribution~20170131~41392031~5~0.0000
Solar~Distribution~20170228~41392031~5~0.0000
Solar~Distribution~20170331~41392031~5~0.0000
Солнечное ~ Распределение ~ 20170430 ~ 41392031 ~ 5 ~ 0.0000
Мой класс java8 pojo с lombok
productCorpusType; productCorpusClass; дата; сделка; ProductCorpus; сумма;
My java class :
-------------------------------------------
*public void getFile() throws IOException {
String path = "./src/main/resources/TaxCreditScheduleReport_20200428.txt";
Path file = Paths.get(path);
int i = 0;
String[] args = null;
List<TaxCreditScheduleReport> taxData = new ArrayList<TaxCreditScheduleReport>();
TaxCreditScheduleReport textData = new TaxCreditScheduleReport();
int num = 0;
if (Files.exists(file)) {
try (InputStream in = Files.newInputStream(file);
BufferedReader bfr = new BufferedReader(new InputStreamReader(in))) {
String line = null;
while ((line = bfr.readLine()) != null) {
if(!line.contains("ProductCorpusType(Subclass)")) {
args = line.split("~");
textData.setProductCorpusType(args[0]);//setting the values
textData.setProductCorpusClass(args[1]);
textData.setDate(args[2]);
textData.setDeal(Integer.parseInt(args[3]));
textData.setProductCorpus(Integer.parseInt(args[4]));
textData.setAmount(args[5]);
taxData.add(textData);
}
}
bfr.close();
} catch (IOException x) {
System.out.println(x);
}
}
System.out.println(taxData);
}***