If I understand you correctly, you got a text file and a physical DBMS like MySQL or Oracle then you can use 1
thread to read data off the text file and another thread to insert data to the DB.
This is like producer/consumer problem. The text file thread is the producer and DB is the consumer. The DB thread listens for any data from the producer, do nothing until there is data.
Another way to look at it is more like doing batch inserts for the DB. Read whole bunch of lines of data then do single insert to the DB.
Either way seems fine to me. The first method is probably better performance wise. The second method may cause SQL problems.