Electrum isn't designed to check thousands of addresses at once.
If you want to check the balance for a lot of addresses, read
List of all Bitcoin addresses with a balance.
Is there an efficient way to extract only the "sec: "<key>", from the text file and export just those keys to import into electrum?
I'd use grep:
grep '"sec": "' file.txt | cut -d'"' -f4