Sublime Text advanced Regular swap replacement function

Source: Internet
Author: User
Tags sublime text

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 a statement such as the following:

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 is the expression: (' \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.

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvywvyy2hp/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70 /gravity/southeast ">


Four, finally another little tail, put); Replace with Blank put );Replaced by Blank

For example, as seen in:

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvywvyy2hp/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70 /gravity/southeast ">


At this point, you are done. Ha ha. Celebrate


Happy to be original. Collection and reprint are strictly forbidden.

This address: http://blog.csdn.net/aerchi/article/details/46739167

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.