0

I'm using csvWriter, the code i'm using it works. Is It possible create a csv with multiple pages, like Excel files?
Here you are the specifics about the project.

List<BookEvent> listBooks = new ArrayList<BookEvent>();

        for (ExaClass examp : examps) {

            listBooks.add(new BookEvent(examp.getExample(), examp.getExample2(), examp.getExampleN()));
        }


        String filename = UUID.randomUUID().toString();
        FileWriter file = new FileWriter(filename);
        ICsvBeanWriter csvWriter = new CsvBeanWriter(file,
                CsvPreference.STANDARD_PREFERENCE);

        String[] header = {"Example1", "Example2", "ExampleN"};

        csvWriter.writeHeader(header);

        header = new String[]{"example1", "example2", "exampleN"};

        for (BookEvent aBook : listBooks) {
            csvWriter.write(aBook, header);
        }

        csvWriter.close();
Shiroga
  • 145
  • 2
  • 8
  • 20

2 Answers2

2

It is not possible to write/create multiple pages.

Refer this link. Creating multiple sheets in CSV file

Community
  • 1
  • 1
Govind
  • 311
  • 1
  • 12
0

Source: Comma-separated values

A comma-separated values (CSV) (also sometimes called character-separated values, because the separator character does not have to be a comma) file stores tabular data (numbers and text) in plain-text form. Plain text means that the file is a sequence of characters, with no data that has to be interpreted instead, as binary numbers. A CSV file consists of any number of records, separated by line breaks of some kind; each record consists of fields, separated by some other character or string, most commonly a literal comma or tab. Usually, all records have an identical sequence of fields.

As the data consists of plain test records there is no concept of pages, so what you want to do is not possible.

DavidPostill
  • 7,734
  • 9
  • 41
  • 60