Combine Columns in CSV file using JAVA <p>I want to combine columns in csv file using java here in this file i want combine first two columns "Product No" and "Product Name".</p> <p>This is My CSV File</p> <pre><code> Productno,Productname,Price,Quantity 1,java,300,5 2,java2,500,10 3,java3,1100,120 </code></pre> <p>Here is My Code</p> <pre><code>private void parseUsingOpenCSV(String filename) { CSVReader reader; FileWriter out = null; CSVWriter outt; try { reader = new CSVReader(new FileReader(filename)); String[] row; try { out= new FileWriter("E:/data/test/newww.csv"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { while ((row = reader.readNext()) != null) { for (int i = 0; i &lt; row.length; i++) { // display CSV values System.out.println(row[i]); String com = row[i]; out.write(com); } } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } catch (FileNotFoundException e) { System.err.println(e.getMessage()); }finally{ if (out != null) { try { out.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } </code></pre> <p>By using this code i get output is below</p> <pre><code>Product No Product Name Price 1 java 300 2 java2 500 3 java3 1100 </code></pre> <p>But I want Output like this....</p> <pre><code> ProductnoProductname,Price,Quantity 1java,300,5 2java2,500,10 3java3,1100,120 </code></pre>