notepad++批量定格式替换
最近在处理一个SQL查询记录的时候,遇到点问题,经过多次查询和探索,现总结下 比如,我sql查询一个表,得出所有车牌,然后,我取这些车牌,批量转换成 车牌号1,车牌号2,.....车牌号n,而且要求最后的结果写到文本文件中就是这样,没空格,换行之类的 之前我的
最近在处理一个SQL查询记录的时候,遇到点问题,经过多次查询和探索,现总结下比如,我sql查询一个表,得出所有车牌,然后,我取这些车牌,批量转换成 '车牌号1','车牌号2',.....'车牌号n',而且要求最后的结果写到文本文件中就是这样,没空格,换行之类的
之前我的做法是:先取这些结果到excel,写入到A1列,然后在B1列,B1=="'"&A1&"'",这样就可以给车牌号加上''
例子:
粤A00000
粤A00001
粤A00002
粤A00003
粤A00004
粤A00005
粤A00006
变换后
'粤 A00001 '
'粤 A00002 '
'粤 A00003 '
'粤 A00004 '
'粤 A00005 '
'粤 A00006 '
'粤 A00007 '
然后,我拷贝B1列到notepad++(不是notepad,这个太弱了)
然后ctrl+H,设置替换, 查找 \n 替换成,
然后就是要去掉空白了,选择编辑,空白操作,EOL转空格
最终结果就是:’粤A00000','粤A00001','粤A00002','粤A00003','粤A00004','粤A00005','粤A00006'
其实这样还是很麻烦,转换好几次,然后我去看了下notepad++,其实有更加简单的方法,替换两次就可以
比如我们还是从SQL查询结果取一列数据到notepad++
然后,替换 \n 替换成 ,'
第一次替换结果为:
粤A00000
,'粤A00001
,'粤A00002
,'粤A00003
,'粤A00004
,'粤A00005
,'粤A00006
,'
然后再次替换,替换 查找目标 \r 替换为 '
结果为:
粤A00000','粤A00001','粤A00002','粤A00003','粤A00004','粤A00005','粤A00006','
然后手动更改一下首尾的两个就可以了
希望大家能给出更简单的方法,最近经常要替换修改这个,还是很麻烦的说

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

1. First, we right-click the blank space of the taskbar and select the [Task Manager] option, or right-click the start logo, and then select the [Task Manager] option. 2. In the opened Task Manager interface, we click the [Services] tab on the far right. 3. In the opened [Service] tab, click the [Open Service] option below. 4. In the [Services] window that opens, right-click the [InternetConnectionSharing(ICS)] service, and then select the [Properties] option. 5. In the properties window that opens, change [Open with] to [Disabled], click [Apply] and then click [OK]. 6. Click the start logo, then click the shutdown button, select [Restart], and complete the computer restart.

QQ email: QQ number@qq.com, English QQ email: English or numbers@qq.com, foxmail email account: set up your own account@foxmail.com, mobile phone email account: mobile phone number@qq.com. Tutorial Applicable Model: iPhone13 System: IOS15.3 Version: QQ Mailbox 6.3.3 Analysis 1QQ mailbox has four formats, commonly used QQ mailbox: QQ number@qq.com, English QQ mailbox: English or numbers@qq.com, foxmail Email account: set up your own account@foxmail.com, mobile phone email account: mobile phone number@qq.com. Supplement: What is qq mailbox? 1 The earliest QQ mailbox was only between QQ users

In the process of PHP development, dealing with special characters is a common problem, especially in string processing, special characters are often escaped. Among them, converting special characters into single quotes is a relatively common requirement, because in PHP, single quotes are a common way to wrap strings. In this article, we will explain how to handle special character conversion single quotes in PHP and provide specific code examples. In PHP, special characters include but are not limited to single quotes ('), double quotes ("), backslash (), etc. In strings

PyCharm is a commonly used Python integrated development environment with rich functions and shortcut keys that can help developers improve programming efficiency. In the daily programming process, mastering PyCharm's shortcut key replacement skills can help developers complete tasks more quickly. This article will introduce you to some commonly used replacement shortcut keys in PyCharm to help you easily improve your programming speed. 1.Ctrl+R replacement In PyCharm, you can use the Ctrl+R shortcut key to perform replacement operations.

jQuery is a classic JavaScript library that is widely used in web development. It simplifies operations such as handling events, manipulating DOM elements, and performing animations on web pages. When using jQuery, you often encounter situations where you need to replace the class name of an element. This article will introduce some practical methods and specific code examples. 1. Use the removeClass() and addClass() methods jQuery provides the removeClass() method for deletion

PyCharm is a powerful Python integrated development environment with rich functions and tools that can greatly improve development efficiency. Among them, the replacement function is one of the functions frequently used in the development process, which can help developers quickly modify the code and improve the code quality. This article will introduce PyCharm's replacement function in detail, combined with specific code examples, to help novices better master and use this function. Introduction to the replacement function PyCharm's replacement function can help developers quickly replace specified text in the code

PyCharm is an integrated development environment popular among programmers. It provides powerful functions and tools to make programming more efficient and convenient. In PyCharm, reasonable setting and replacement of shortcut keys is one of the keys to improving programming efficiency. This article will introduce how to replace shortcut keys in PyCharm to make programming more convenient. 1. Why should we replace shortcut keys? In PyCharm, shortcut keys can help programmers quickly complete various operations and improve programming efficiency. However, everyone has different habits, and some people may

With the continuous updating of win10 system, its original installation image is getting larger and larger, which brings troubles to students who like to use U disk for UEFI boot method installation. As we all know, using EFI method to install the system directly installs the original Microsoft image. After decompressing, copy to the root directory of the U disk in fat32 or fat16 format, and then directly set the motherboard U disk to start the installation. However, many friends have reported that it backfired recently. There is a restriction on using the U disk in fat format, that is, a single file. The maximum cannot exceed 4G, otherwise it will be impossible to write. However, as the win10 image increases, the install.wim file in the installation package becomes larger and larger, exceeding 4G, which makes it impossible to directly use
