There is a need to convert an INSERT statement from a data table data exported from MySQL into an UPDATE statement.
You need to put the following statement:
Insert INTO ' table ' (' ID ', ' Code ', ' detail ') VALUES (' 1 ', ' 110000 ', ' xx city ');
Change to: Update table Set detail = ' xx city ' where code = ' 110000 '
Studied for a long time.
Here's how it's implemented:
First. Open data file original data file with sublime
1. Figure I: Raw data.
2. Use regular to match: (' 1 ', ' 110000 ', ' Beijing '); Here the regular expression is: (' \d+ '), (' \d+ '), (' \s+ ')
In the second step, Ctrl + H opens the current replacement mode and matches and replaces it with regular.
Third, replace the successful result.
Finally, there is a little tail, put it); Replace with Blank put
);Replaced by
Blank
As shown in the following:
At this point, you are done. Haha, celebrate.
Happy to be original, strictly forbidden to collect and reprint
This address: http://blog.csdn.net/aerchi/article/details/46739167
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Sublime Text advanced Regular swap replacement function