/ ***************
Data file B.TXT format
*****************
Export data a.sql format
INSERT INTO XXX (`a`,` b`) Values ('1-1', '1-2');
INSERT INTO XXX (`a`,` b`) VALUES ('2-1', '2-2');
INSERT INTO XXX (`a`,` b`) VALUES ('3-1', '3-2');
**************** /
$ INPUT = 'b.txt'; # data file
$ output = 'a.sql'; # export data
$ special = array ("
$ key_word = array ('', '', '', ' b>');
$ SQL_PRE = 'INSERT INTO XXX (`a`,` b`) Values';
##############################
$ fp = file ($ INPUT);
$ I = 0;
Foreach ($ FP AS $ Key => $ VAL) {
IF (REPLACE ($ fp [$ key])! = ') {
$ content. = $ sql_pre. "(". Replace ($ FP [$ Key]). "); / r / n";
$ i ;
}
}
IF (Write ($ OTPUT, $ Content))