Notepad ++ batch set format replacement

Source: Internet
Author: User
Recently, when processing an SQL query record, I encountered some problems. After multiple queries and explorations, I summarized the following: for example, I used SQL to query a table and obtained all license plates. Then, I took these license plates and converted them into license plate numbers 1, license plate numbers 2 ,..... license plate number n, and the final result is required to be written to a text file. There is no space, and before the line break, my

Recently, when processing an SQL query record, I encountered some problems. After multiple queries and explorations, I summarized the following: for example, I used SQL to query a table and obtained all license plates. Then, I took these license plates and converted them into license plate numbers 1, license plate numbers 2 ,..... license plate number n, and the final result is required to be written to a text file. There is no space, and before the line break, my

I recently encountered some problems when processing an SQL query record. After multiple queries and explorations, I will summarize the following:



For example, I used SQL to query a table and obtain all the license plates. Then, I took these license plates and converted them into 'license plate number 1', 'license plate number 2 ',..... 'license plate number n', and the final result is required to be written to a text file. There are no spaces, line breaks, and so on.



My previous practice was to take the results to excel, write them to column A1, and then in column B1, B1 = "'" & A1 &"'", in this way, you can add ''to the license plate number''

Example:



Guangdong A00000
Guangdong A00001
Guangdong A00002
Guangdong A00003
Guangdong A00004
Guangdong A00005
Guangdong A00006

After conversion

'Guangdong a0000001'
'Guangdong A00002'
'Guangdong A00003'
'Guangdong A00004'
'Guangdong A00005'
'Guangdong A00006'
'Guangdong A00007'




Then, I copied the B1 column to notepad ++ (not notepad, this is too weak)

Then ctrl + H, set replace, find \ n and replace it,

Then, you need to remove the blank space. Select "edit" and click "blank" to convert "EOL" to "space ".

The final result is: 'guangdong a00000', 'guangdong a0000000000000000000000000000000000000000000000000000000000000000000000000000000000'



In fact, this is still very troublesome. After several conversions, I checked notepad ++. In fact, there is a simpler method. I can replace it twice.

For example, we still retrieve a column of data from the SQL query results to notepad ++

Then replace \ n ,'

The first replacement result is:

Guangdong A00000

, 'Guangdong A00001

, 'Guangdong A00002

, 'Guangdong A00003

, 'Guangdong A00004

, 'Guangdong A00005

, 'Guangdong A00006

,'



Then replace it with the find target \ r'

Result:

Guangdong a00000', 'guangdong a0000000000000000000000000000000000000000000000000000000000000000000000000000 ','

Then manually change the first and last two.



I hope you can give us a simpler method. It is very troublesome to replace and modify this method recently.

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.