I am using following code:
CsvSchema bootstrap = CsvSchema.emptySchema().withHeader();
ObjectMapper mapper = new CsvMapper();
File csvFile = new File("input.csv"); // or from String, URL etc
Object user = mapper.reader(?).withSchema(bootstrap).readValue(new File("data.csv"));
mapper.writeValue(new File("data.json"), user);
It throws an error in my IDE saying cannot find symbol method withSchema(CsvSchema)
but why? I have used the code from some examples.
I don't know what to write into mapper.reader()
as I want to convert any CSV file.
How can I convert any CSV file to JSON and save it to the disk?
What to do next? The examples