I have a file with almost 700mb that has numerous lines with Json inside it. I need to treat each json line-by-line and insert them into my database.
The question is, I'm currently using the following code:
using (StreamReader arquivo = new StreamReader(System.IO.File.OpenRead(file), Encoding.UTF8))
{
while (arquivo.Peek() > -1)
{
//tratamento do arquivo.
}
}
How can I read the lines in parallel to make the process faster?