Sublime Text advanced Regular swap replacement function

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.