0
var input = File(response)
        try {
            var csv = CsvSchema.emptySchema().withHeader();
            var csvMapper = CsvMapper();
            var mappingIterator: MappingIterator<Map<String, String>> =  csvMapper.reader().forType(Map.class).with(csv).readValues(input);
            val list: List<Map<String, String>> = mappingIterator.readAll();
            println(list);
        } catch(Exception e) {
            e.printStackTrace()
        }
    }

问题在于fortype()行中的功能var mappingIterator: MappingIterator<Map<String, String>> = csvMapper.reader().forType(Map.class).with(csv).readValues(input)

4

0 回答 0