
AsymptoticCoder
New User
Jan 16, 2005, 4:49 PM
Post #1 of 3
(1594 views)
|
|
Extracting Stuff from a SQL Table Dump
|
Can't Post
|
|
I am not sure how to approach this, but I am pretty sure I need a regular expression. I have several hundred SQL statements like this from a table dump in a dump file:
INSERT INTO `cpg132_pictures` VALUES (1, 2, 'webpics/nyc/', 'FILENAME', 18891, 20930, 233, 350, 0, '20041125144226', 1096680526, 1, '', 0, 0, '', 'DESCRIPTION', '', 'YES', '', '', '', '', 0, 2, '', ''); I want to extract FILENAME and DESCRIPTION from the statement so that I can form and output UPDATE queries in a new file, like:
UPDATE cpg132_pictures SET caption='DESCRIPTION' WHERE filename='FILENAME'; How would I go about this? Thanks, Ryan
|