Forum Stats

  • 3,874,115 Users
  • 2,266,686 Discussions


if the size of the file is greater than 1 then write the invalid records to output file

4281104 Member Posts: 2
edited Jul 2, 2020 10:38PM in Java User Groups Discussions

  I have mentioned only part of a code. so I need to check if the records are invalid and write in to file. So if the size of the file is greater than 1. I need to copy those records from the original file to the new file. How do I do it

public void startProcessing()

for (String fileName : fileNames)

{ OutputRecords outputRecords = generateOutputRecords(fileName);

List<EDCOutputRecord> listOfEdcOutputRecords = outputRecords.getValidOutputRecords();

List<EDCOutputRecord> listOfInvalidApplicantTypeRecords = outputRecords.getInvalidApplicantTypeRecord();

outputFileWriter.writeIntoFile(listOfEdcOutputRecords); inputFileHandler.moveInputFileToProcessedDirectory(fileName);