Splitting text file in android
<p>I am developing an android app and i need it to read a text file. Once it has read the text file I need to <code>save certain parts</code> to a database. 
The text file contains the following:</p>

<pre><code>Title - Hello
Date - 03/02/1982
Info - Information blablabla

Title - New title
Date - 04/05/1993
Info - New Info
</code></pre>

<p>I thought that I need to split the text file in two by using the blank line as a <code>separator</code>. Then I need to get the individual info like the Title and save it into the database as a title. Is there some way to do this? I know how to read all of the text file. I am using this to read the <code>complete</code> text file. </p>

<pre><code>    TextView helloTxt = (TextView) findViewById(R.id.hellotxt);
    helloTxt.setText(readTxt());

}

private String readTxt() {

    InputStream inputStream = getResources().openRawResource(R.raw.hello);

    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

    int i;
    try {
        i = inputStream.read();
        while (i != -1) {
            byteArrayOutputStream.write(i);
            i = inputStream.read();
        }
        inputStream.close();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    return byteArrayOutputStream.toString();
}
</code></pre>

<p>I was just wondering about the splitting event of this.
Thank you </p>
