Note that there are some explanatory texts on larger screens.

plurals
  1. POParsing text file line by line to array using BufferedInputStream with RTL characters in Java
    primarykey
    data
    text
    <p>Guys I need to understand something: the \n comes at the begining of a new line currect? If so, I am trying to parse a file that has RTL characters in it and they are at the begining of a line, so:</p> <ol> <li>xxx xxxx, ABC DEFG, 1, 11, 111, 786</li> <li>xxx xxxx, ABC DEFG, 1, 11, 111, 786</li> <li>etc...</li> </ol> <p>when parsing the txt file (android from assets) I keep getting the first word from the next line concatenated to the Integer from the previous line. I have tried everything but with no luck.</p> <p>Here is a code snippet:</p> <pre><code> InputStream is; try { is = new BufferedInputStream(getAssets().open(fileName)); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { InputStream is = new BufferedInputStream(getAssets().open(fileName)); byte[] c = new byte[128]; byte[] d = null; int readChars = 0; int lineNumber = 0; String line; String[] paramLineArray = null; int k; while ((readChars = is.read(c)) != -1) { for (int i = 0; i &lt; readChars; i++) { if (c[i] == '\n') { lineNumber++; line = new String(c); k = 0; StringTokenizer st = new StringTokenizer(line,","); paramLineArray = new String[st.countTokens()]; while (st.hasMoreTokens()) { // get next token and store it in the Line paramLineArray[k] = st.nextToken(); k++; } } } publishProgress(((int) (1 / (float) lineNumber) * 100)); populateTables(paramLineArray, tblName, tblElements); } </code></pre> <p>What I am trying to achieve is this:</p> <p>Parse the text file really fast Line by line into an array that is the inserted into a DB...</p> <p>Any ideas???</p> <p>Help is much appreciated as I've been at it for days now (loosing my hair :-()...</p> <p>Currently I have code working with InputStreamReader but it is very slow!!!!!</p> <p>Thank you.</p> <p>JadeYe.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload