Capturing part of string from a txt file?
<p>I have a text file like this, separated by ";"
1022-3, 1603-4, 2012-5, 2489-6;</p>

<p>Gotta catch the first part before the "-" and pass to variable, and compare with milliseconds, if is equal the number, capture the number after of "-". 
And do so with the next number after the semicolon, and so front.</p>

<pre><code>public static long MilliSeconds() {
    // get Calendar instance
    Calendar now = Calendar.getInstance();

    return now.getTimeInMillis();

}
</code></pre>

<p>And the beginning of the code to do what I need this here</p>

<pre><code>private void LerArquivo() {
        String lstrNomeArq;
        File arq;
        String lstrlinha;
        long tempoInicio = 0;
        long tempoDecorrido = 0;
        try {

            tempoDecorrido = (RecordSound.MilliSeconds() - tempoInicio); 


            lstrNomeArq = "/Android/data/br.com.couldsys.drumspro/cache/GravaSound.TXT";

            String conteudotexto = "";

            arq = new File(Environment.getExternalStorageDirectory(),
                    lstrNomeArq);
            BufferedReader br = new BufferedReader(new FileReader(arq));

            // pega o conteudo do arquivo texto
            conteudotexto = br.readLine();

            String capturaIndex = ("Conteudo do texto: "
                    + conteudotexto.substring(
                            conteudotexto.indexOf("-") + 1,
                            conteudotexto.indexOf(";",
                                    conteudotexto.lastIndexOf("-"))));


            if (tempoDecorrido == capturatempo) { 

                DrumsProActivity.vsm.playSound(capturaindex);
                // ler a nova linha
                // se chegar ao final do string então para o while
                if (conteudotexto.length() &gt; 0) {
                    executar = false;
                }

            }

        } catch (Exception e) {
            trace("Erro : " + e.getMessage());
        }
    }
</code></pre>
