regex help with csv sql dump

From: Clay Scott <rudeboy@gci.net>
Date: Sat Oct 21 2006 - 15:36:22 AKDT

i generated a mysql dump file for a database generated by an app i'm helping a friend write. now he's changed the database layout again and i'm having a hard time getting the dump file into the proper format to be imported back into mysql. in one particular table some fields have been added, but i've since learned how to use sed to add empty fields to the end of the csv string (thanks arthur!).

my problem is that in one particular table the number of fields has been reduced. some fields have been done away with complete and the rest moved to another table. the field count has dropped from 30 to 24 and i'm having a hell of a time trying to get the regex right to drop the appropriate fields. basically the lines look like a standard csv dump file:

INSERT INTO `table` VALUES ('value1', 'value2', 'value3', 'value4',....,'value30');

it would be easier if the fields were all at the beginning or end of the string, but they're all throughout. i need to drop fields 9, 10, 11, 12, 14 and 20.

any help would be greatly appreciated...

~clay
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sat Oct 21 15:36:50 2006

This archive was generated by hypermail 2.1.8 : Sat Oct 21 2006 - 15:36:50 AKDT