Input file parsing to insert into DB
Hi,
I have a sample input file as follows:
++++++++++ 2009-09-28 15:10:58 ++++++++++++++
++++++++ DAILY SCORES +++++++++++++++++
2009-09-28 15:10:58|AAAA|0
2009-09-28 15:10:58|BBBBB|0
2009-09-28 15:10:58|ACCCC|0
++++++++ MONTHLY SCORES +++++++++++++++++
2009-09-28 15:10:58|AAAA|30
2009-09-28 15:10:58|BBBBB|50
2009-09-28 15:10:58|ACCCC|60
I should ignore first line and then look for "DAILY SCORES" or "MONTHLY SCORES"string. This determines which MySql table has to be used.
Then read the following lines delimited by pipe and insert them into MySql table
Table schema is as follows:
------------------------------------------------------------
dateandtimestamp | program | score
------------------------------------------------------------
Please suggest the best approach to do this.
Thanks,
Mona.