title: Merging multiple csv files in java
body: <p>I have 3 csv files. Each file contains 10 columns but only 1 of them has different values.</p>
  
  <p><strong>Dutch</strong>
  <a href="https://i.stack.imgur.com/kCEs5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kCEs5.png" alt="Dutch"></a></p>
  
  <p><strong>French</strong>
  <a href="https://i.stack.imgur.com/FbKWM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FbKWM.png" alt="French"></a></p>
  
  <p><strong>English</strong>
  <a href="https://i.stack.imgur.com/BrlPd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BrlPd.png" alt="English"></a></p>
  
  <p>As shown in the pictures, only the destination name is different per language.</p>
  
  <p>What I want to become is csv file looking like this:
  <a href="https://i.stack.imgur.com/4nz1I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4nz1I.png" alt="Merged csv&#39;s"></a></p>
  
  <p>How do I put the columns between the existing columns and how do I change their headers as wel (DEST_NAME_DISPLAY --> DEST_NAME_EN)?</p>
  
  <p>So far I've little experience with csv manipulation besides reading a csv file with <a href="https://super-csv.github.io/super-csv/index.html" rel="nofollow noreferrer">Super csv</a></p>
  
  <p><strong>Example of what i know so far</strong></p>
  
  <pre><code>public List&lt;City&gt; readWithCsvMapReader(String file, String source) throws IOException, AuthenticationException, RepositoryException {
      ICsvMapReader mapReader = null;
      FileInputStream stream = new FileInputStream(file);
      InputStreamReader reader = new InputStreamReader(stream, ENCODING);
      try {
          mapReader = new CsvMapReader(reader, PREFERENCE);
          final String[] header = mapReader.getHeader(true);
          final CellProcessor[] processors = getProcessors();
          Map&lt;String, Object&gt; locationMap;
          while ((locationMap = mapReader.read(header, processors)) != null) {
              /*do some logic*/
          }
      } finally {
          if (mapReader != null) {
              mapReader.close();
          }
      }
  }
  
  public CellProcessor[] getProcessors() {
      final CellProcessor[] processors = new CellProcessor[]{
              new NotNull(), // COU_ID
              new NotNull(), // COU_NAME
              new NotNull(), // DEST_ID
              new NotNull(), // DEST_NAME_DISPLAY
              new Optional(), //DEST_PARENT_ID
              new NotNull(), // DEST_STATION_COUNT
              new NotNull(), // DEST_CHILD_DEST_COUNT
              new NotNull(), // DEST_FLAG_APT
              new NotNull(), // DEST_FLAG_WIN
              new NotNull(), // DEST_FLAG_DEL
      };
      return processors;
  }
  </code></pre>