How to parse a String into multiple arrays
<p>Good day!</p>

<p>I am making a mini bookstore program and we are required to read a file based from what the customer buys on the specified counter as follows:</p>

<pre><code>counter 4,book1 2,book2 2,book3 2,tender 100.00
counter 1,book1 2,book2 1,book3 3, book4 5,tender 200.00
counter 1,book3 1,tender 50.00
</code></pre>

<p>In short the format is:
COUNTER -> ITEMS BOUGHT -> TENDER</p>

<p>I tried doing this but it is not that efficient:</p>

<pre><code>public List&lt;String&gt; getOrder(int i) {
        List &lt;String&gt; tempQty = new ArrayList&lt;String&gt;();
        String[] orders = orderList.get(0).split(",");
        for (String order : orders) {
            String[] fields = order.split(" ");
            tempQty.add(fields[i]);
        }
        return tempQty;
}
</code></pre>

<p>How can i read the file and at the same time, ensures that I will put it on the correct array? Besides the counter and the tender, I need to know the name of the book and the qty so I could get its price and computer for the total price. Do I need to do multiple arrays to store each values? Any suggestions/ codes will be 
highly appreciated.</p>

<p>Thank you.</p>
