How to split strings into columns
<p>I have a list of Strings in single column. I want to make three columns from these string and then  print the ouput to another file. How do I do this?</p>

<p>Here is what I've tried so far:</p>

<pre><code>ArrayList&lt;String&gt; list=new ArrayList&lt;String&gt;();
File file = new File("f://file.txt");

try {
    Scanner scanner = new Scanner(file);

    while (scanner.hasNextLine()) {
        String line = scanner.nextLine();
        System.out.println(line);
    }

    scanner.close();
} catch (FileNotFoundException e) {
    e.printStackTrace();
}
</code></pre>

<p>My input data:</p>

<pre><code>City
Gsk
Relocation
sripallu
here
jrajesh
gurgaon
unitech
StatisticsThreads
WizOty
LTDParsvnathK
Quotesby
newest
PMaashuktr
</code></pre>

<p>My expected output:</p>

<pre><code>City      Gsk      Relocation
sripallu here      jrajesh
gurgaon  unitech   StatisticsThreads
WizOty   LTDParsvnathK  Quotesby
newest   PMaashuktr      Loans
.
.
.
.
.
.
.
</code></pre>
