Check out example codes for "add uuid to csv". It will help you in understanding the concepts better.

Code Example 1

BufferedReader csvReader = new BufferedReader(new FileReader("Path to existing csv"));
        String delimiter = ","
        List<List<String>> rows = new ArrayList<>();
        String row;
        while ((row = csvReader.readLine()) != null) {
            String[] data = row.split(delimiter);
            rows.add(Arrays.asList(data));
        }
        csvReader.close();

        FileWriter csvWriter = new FileWriter("Path to final csv");
        for (List<String> rowData : rows) {

            csvWriter.append(UUID.randomUUID().toString());
            csvWriter.append(delimiter);
            csvWriter.append(String.join(delimiter, rowData));
            csvWriter.append(System.lineSeparator());
        }
        csvWriter.flush();
        csvWriter.close();

Learn ReactJs, React Native from akashmittal.com