notepad++

Change Text File Encoding

瘦欲@ 提交于 2020-03-23 23:23:40
问题 How do you change a text files encoding through code? I am using this code to actually create the file itself, but how can I change the encoding (change to UTF-8 w/o BOM) string path = @"E:\Test\Example.txt"; if (!File.Exists(path)) { File.Create(path); } 回答1: You could do something like that, but I'm not sure this makes really sense, as it seems you have no content in your file... If you have a content, replace string.Empty by the content File.WriteAllText(path, string.Empty, Encoding

maven集成freemarker构建word文件下载

流过昼夜 提交于 2020-03-09 11:30:42
1.引入freemarker < dependency > < groupId > org.freemarker </ groupId > < artifactId > freemarker </ artifactId > < version > 2.3.28 </ version > </ dependency > 2.构建word模板,先创建word文件, 注:本人使用的2003版本的word文档,其他版本未进行测试 3.创建完后word文件后,取名:temp.doc文件,并打开temp文件,另存为temp.xml格式文件;保存类型选择如下: 4.打开temp.xml文件,使用Notepad++文本编辑器,需要安装一个组件,选择插件=》插件管理,进入插件列表,并在可用里面搜索:Xml tool,并进行安装,安装后如下: 然后打开xml文件,进行文件格式化处理 打开文件后,并在文件找到其想替换的字符,如想替换jim,需要在xml中找到jim字符, 使用freemarker标签替换为${author} 表格替换 替换完成后,把temp.xml文件的后缀改成ftl格式,temp.ftl 5.构建ftl转换冲word的工具类 import freemarker.template.Configuration; import freemarker.template.Template;

Run a batch file from its parent directory in NotePad++

ぃ、小莉子 提交于 2020-03-05 00:30:42
问题 I made a batch file that identifies java files kept in that particular folder and compiles them. But when I was running it from notepad++, the batch file was going to notepad++ working directory i.e. C:\Program Files\Notepad++ , and then starting, so I was not getting desired output. <Command name="Java_Executor" Ctrl="no" Alt="no" Shift="no" Key="0">"D:\Projects\Java\Executor Java.bat"</Command> I tried to edit it many times but didn't got desired output. <Command name="second try" Ctrl="no"

How can i remove duplicated lines (txt file)?

走远了吗. 提交于 2020-02-27 03:55:26
问题 today I was trying to remove duplicate lines on a simple text file, something like: input (list.txt): hello hello try output (list.txt): try i was trying with notepad++ to remove duplicate rows and remove the remaining one but nothing. is there a software o some function for do this with notepad++? thanks. 回答1: Assuming the file is sorted, to have all duplicate lines together. Ctrl + H Find what: ^(.+(?:\R|$))\1+ Replace with: LEAVE EMPTY check Wrap around check Regular expression DO NOT

Notepad++ RegEx replace with pattern

戏子无情 提交于 2020-01-30 13:28:32
问题 I want to find the following pattern: Image not found: /Images/IMG-20160519-WA0015.jpg And replace with some markup, including the image name from the above text like: <a href="IMG-20160519-WA0015.jpg"><img src="IMG-20160519-WA0015.jpg" width="180" height="240" alt="IMG-20160519-WA0015.jpg" class="image" /> Is it possible with some kind of Regex or plugin or I'm simply burning neurones? Thanks. 回答1: Try finding ^Image not found: \/Images\/(IMG-.*\.jpg) and replacing with <a href="\1"><img src

regex replacing at beginning of line in notepad++

a 夏天 提交于 2020-01-30 08:43:45
问题 for example I have txt with content qqqqaa qqss ss00 I want to replace only one q at the beginning of line, that is to get qqqaa qss ss00 I tried replace ^q in notepad++. But After I click replaceAll, I got aa ss ss00 What is wrong? Is my regex wrong? What is the correct form? 回答1: The issue is that Notepad++ Replace All functionality replaces in a loop using the modified document. The solution is to actually consume what we need to replace and keep within one regex expression like ^q(q*) and

Notepad++ regex backreference doesn't seem to work

余生颓废 提交于 2020-01-30 04:51:34
问题 I need to add ; at the end of every line that does not end with : , { , } or ) . I'm using this in Notepad++: Search for: [^:\{\}\)]$ Replace with: \1; It finds the strings all right but it replaces the last character found before the end of line with ; instead of adding it to it. I tried $1 instead of \1 but it didn't change anything — the found text still gets deleted. 回答1: Your pattern has no capturing group, hence \1 is an empty string. Use $0 instead to refer to the whole match: Find

How can I enable auto complete support in Notepad++?

自作多情 提交于 2020-01-27 08:52:08
问题 I am trying to add simple syntax highlighting and auto completion for a simple scripting language... I added syntax highlighting using this article Now I want to know how to enable auto completion with Notepad ++ for my custom language. Does anyone know how to do that? 回答1: For basic autocompletion, have a look at the files in %ProgramFiles%\Notepad++\plugins\APIs . It's basically just an XML file with keywords in. If you want calltips ("function parameters hint"), check out these