Display a loading while processing a while loop

Hello,
In one moment of my game, the player is able to import a file to the game.
That’s the function that read each line of the file:

void readTextFile(string file_path)
{
StreamReader inp_stm = new StreamReader(file_path);

    while (!inp_stm.EndOfStream)
    {
        string inp_ln = inp_stm.ReadLine();
        print(inp_ln);
        // Do Something with the input. 
    }

    inp_stm.Close();
}

The problem is that when import a huge file, it takes almost 3 minutes to read it, so it looks like it stoped responing, but is acctually processing the file.
So, I would like a loading dialog to show the user that the application did not stop.
But how I do that if the application is tied in the “while”?
Thanks.

StreamReader is working in one run so you cannot cut it in sub section.

You’d be better off trying with WWW class using a local url. Then you can yield and animate something in the meanwhile.