Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
load and assign 3MB, 70,000 lines txt to array in a minute?
#1
Hi everyone,

I have a question, Is it possible to load a text file as large as 3 MB, around 70 thousand lines and then assign each lines to array variable in less than a minute or in a matter of seconds? It took me about 5 minutes to load and assign everything to array variable. I thought maybe there's a way to load the file directly to memory then it might be faster to fill in the data to array variable?

this is the code that I used:

str data
data.getfile("$desktop$\data.txt")
data.trim
int nrlines=numlines(data)

ARRAY(str) lines.create(nrlines)

for i 0 nrlines
lines[i].getl(data i)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)