What's the most efficient way of extracting information from huge files?

Viewed 29

I have to work with really big files (up to 1GB) and I need to extract some relevat information. Currently I parse the file line by line and extract only the information I need, but even so, it takes a lot of time.

I'm using electron because I need cross platform compatibility, what would be a good optimization?

My code looks something like this

const info = [];
readline.on("line", function(line) {
   if(condition(line)) {
      info.push(line);
   }
})
0 Answers
Related