How can I generate the code-containing comments like mysqldump?
Well you can review what mysqldump does on git and try working on it!! Though I'd not go this way...

Few things to suggest:


You want to hide column names 


--> use --no-create-info to dump only data. (onlydata.sql)

--> Have standard table definitions ready and intact for dev server. (definition.sql)

--> Refreshing dev => load definition.sql and then onlydata.sql


Just to note that you can also restrict datadump with --where clauses and even limit that to dump only a few rows.


mysqldump --no-create-info --where " true limit 10000" | gzip &gt; dump.sql.gz

.


You want to remove few values from the dump? Well writing tool for searching strings will again cause long time to parse!


--> You might consider setting up a special slave on which you make your changes and then do a full datadump.

--> You can prepare SQL commands to run after dump load finishes as follows:
update secrettable set secretcolumn='xxxxxx' where secretcolumn='reallysecretthing';