public void toFile(Path outputPath, Boolean printHeader) {
        List<String> outputList = new ArrayList<>();

        if (printHeader) {
            outputList.add(this.header.toCSVString());
        }

        this.records.forEach(e -> outputList.add(e.toCSVString()));

        try {
            Path path = Files.write(outputPath, outputList, Charset.forName("UTF-8"), StandardOpenOption.TRUNCATE_EXISTING);
            System.out.println("File is written to: " + path.toAbsolutePath().toString());
            System.out.println("Writing " + (outputList.size() - (printHeader ? 1 : 0)) + " lines of records");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }