limit loadStrings
in
Programming Questions
•
2 months ago
Hi,
I'm trying to limit the length of an array loaded with loadStrings().
For best performance I have to analyze only the 20 first lines of documents (.pdf files) who have more than 7 thousands of lines.
I saw this topics so I try this :
thanks
I'm trying to limit the length of an array loaded with loadStrings().
For best performance I have to analyze only the 20 first lines of documents (.pdf files) who have more than 7 thousands of lines.
I saw this topics so I try this :
- InputStream is = createInput("theUrlOfMyPdfDocument");
String line = null;
try
{
BufferedReader reader = new BufferedReader(new java.io.InputStreamReader(is, "UTF-8"));
while ( lines.size() < 20)
{
lines.add(line);
}
}
catch (IOException e)
{
e.printStackTrace();
}
println(lines.size()); // print 20
println(lines[0].get()); // don't work
exit();
thanks
1