Arranging array of String from bytes : <p>I am new to java and trying to process some logic. I have file </p>

<pre><code>5049,INF
5049,INF
5049,INF
5049,INF
5049,INF
5051,INF
5051,INF
5051,BNF
5051,TNF
</code></pre>

<p>I need this file data in string concatenation like </p>

<p>pIntString value is 5049,5051 and pString value is INF,BNF,TNF.</p>

<p>My Java Code </p>

<pre><code>    Path path = Paths.get(fileName);
    byte[] data = Files.readAllBytes(path);

    String str = new String(data);
    //System.out.println(data.toString());
    String[] strValue = str.split(",");
    String pushidString = null;
    String pIntString = strValue[0];

    for (int i=0;i&lt;strValue.length-2;i++) {

        pushidString = strValue[i+2];
        pIntString = pushidString + pIntString;


    }
</code></pre>

<p>But this code lack basic logic. Any help would be appreciated</p>
