I'm exporting my data as a .csv file.
I want the first column to be the name and age (separated by a semicolon), with the Address in the second column, both on a single row.

I'm getting the name and age together in one cell, but the address is going on the next row rather than in the second column of the same row.

How should I separate it to get Address to next column?

```
btnPrint_4 = new JButton("Print");
btnPrint_4.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent arg0) {
        //export Excel file
        try{

            new JTextField();
            // create new file
            String path="C:\\ExcelFile.csv";
            File file = new File(path);

            // if file doesnt exists, then create it
            if (!file.exists()) {
                file.createNewFile();
            }

            FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
            BufferedWriter bw = new BufferedWriter(fw);
            // write in file                     
            if (txtName.getText() !=null && txtAge.getText() !=null) {
                bw.write(txtName_4.getText());
                bw.write(";");
                bw.write(txtAge.getText());
                //bw.write(System.getProperty("line.separator"));              
                //bw.write("\n");
                bw.write(";");
                bw.write(txtAddress.getText());

            } else {    

                System.out.print("Error :" );
            }                      
            // close connection
            bw.flush();
            bw.close();
            fw.close();
        } catch(Exception e) {
            System.out.println(e);
        }       

```

Expected Output

[![enter image description here](https://i.stack.imgur.com/PeK6v.jpg)](https://i.stack.imgur.com/PeK6v.jpg)