I have a huge MySQL Dump with lots of insert statement using the multiple rows syntax. I need to search for specific content in each row, therefore I want to split the statement to have each row in a extra string.
INSERT INTO tbl_name (a,b,c)
VALUES (1,2,'test1'),
(4,5,'test2 (test2a),
(test2b)'),(7,8,'test3');
Result should be a list of the 3 blocks
[
"1,2,'test1'",
"4,5,'test2 (test2a),(test2b)'",
"7,8,'test3'"
]
Question, what is the most efficient way to achieve this. Is it regular expression with some magic? Language does not matter for me. Can do with Java, PHP, Perl ...