I have some automated task to be done using certain types of logs generated on the server end of each day. Log files contains specific machine identification MAC that is to be re-written in to another text file converted into machine's name.SAMEPE LOG DATA FILES EACH CONTAINING ~2 MILLIONS LINES IN BINARY FORMAT-----------|--------|-----------------|----|----------|---------DATE       |TIME    |MAC_ADDRESS      |PORT|IP_ADDRESS|BLA BLAA-----------|--------|-----------------|----|----------|----------19-01-2014 |18:16:42|A3:43:31:11:02:1A|22  |19-01-2014 |18:16:43|A3:43:31:11:12:1A|22  |19-01-2014 |18:16:43|A3:43:31:11:12:1A|21  |19-01-2014 |18:16:44|A3:43:31:11:12:22|80  |19-01-2014 |18:16:44|A3:43:31:11:12:00|443 |19-01-2014 |18:16:45|A3:43:31:AA:12:AA|5800|19-01-2014 |18:16:46|A3:43:31:AA:30:1A|21  |The above records I need them to be converted to text format, the MAC address replaced with machine name from my machine name database. My current program, read each line from the above file and find the machine name from machine name db matching the MAC_ADDRESS of read data and write each of them to text file.This is my question.My program is written in C language. I have two option to manage the machine names DB, first is to have a sqlite db or else second option is to have a flat binary file. I consider the performance. I am afraid, using db for this would be less performance compare to file as it takes times for the connect/disconnect on processing of each line of log. even though, I am not clear on my point still.Please consider the number of records and suggest me whether is it better to use flat file for sqlite db for storing machine names records. 
using flat file vs sqlite db for frequent data grabbing in a cron job
c;data