Notepad++ 如何使用记事本从txt打开一组文件++;
例如,我在list.txt中保存了一些链接:Notepad++ 如何使用记事本从txt打开一组文件++;,notepad++,Notepad++,例如,我在list.txt中保存了一些链接: d:\phpnow\htdocs\pm\includes\templates\slucky\common\tpl_gallery_display.php d:\phpnow\htdocs\pm\includes\templates\slucky\common\tpl_main_page.php d:\phpnow\htdocs\pm\includes\templates\slucky\templates\tpl_main_page.php d:\ph
d:\phpnow\htdocs\pm\includes\templates\slucky\common\tpl_gallery_display.php
d:\phpnow\htdocs\pm\includes\templates\slucky\common\tpl_main_page.php
d:\phpnow\htdocs\pm\includes\templates\slucky\templates\tpl_main_page.php
d:\phpnow\htdocs\pm\includes\templates\slucky\templates\tpl_product_info_display.php
d:\phpnow\htdocs\pm\includes\templates\slucky\templates\tpl_product_info_display2.php
我想在记事本++中打开它们。有什么插件可以完成这项工作吗?您不需要新的插件。您可以使用命令行执行此操作,并且必须将所有以空格分隔的文件作为命令行参数。您可以从记事本++文档中找到此详细信息。可以创建用于执行命令的bat文件 例如:
/NotePad++.exe“路径到文件1”“路径到文件2”
编写一个名为openfromfiles.bat的批处理文件并执行它
@echo off
setlocal enableextensions enabledelayedexpansion
set LIST=
for /f %%x in (list.txt) do (
set LIST=!LIST! "%%x"
)
echo %LIST%
"C:\Program Files\Notepad++\notepad++" %LIST%
下面是解释批处理文件的链接。。
创建会话文件:
<NotepadPlus>
<Session>
<mainView>
<File filename="PATH_TO_FILE_1"/>
<File filename="PATH_TO_FILE_2"/>
<File filename="PATH_TO_FILE_#"/>
</mainView>
</Session>
</NotepadPlus>
加载它:文件->加载会话…所选答案不太好-长列表失败。相反:
for /f %%x in (list.txt) do (
start "" "C:\Program Files\Notepad++\notepad++" "%%x"
)
最简单的方法就是打开所有你通常会打开的文件。 然后保存会话 将会话文件保存到方便的位置 然后,只要你想打开那批文件,就用记事本++打开该文件。无需创建脚本、批处理或手动创建会话文件。对于powershell脚本:
Param
(
[Parameter(Mandatory=$true)]$File
)
Get-Content -Path $File | foreach {& "C:\Program Files\Notepad++\notepad++" $_}
或powershell concole
Get-Content -Path <File> | foreach {& "C:\Program Files\Notepad++\notepad++" $_}
Get Content-Path | foreach{&“C:\Program Files\Notepad++\Notepad++”$\u0}
Where-列表的文件路径
干得好 我使用Git Bash,以便将find的结果导入记事本++:
find-键入f-name“*.csproj”| xargs“C:\Program Files\Notepad++\Notepad++.exe”
如果like命令太长,则无法工作。你必须创建一个会话文件来解决这个问题。不知道为什么会被否决。我试过了,效果很好。(加载保存的会话之前,请关闭所有文件。)
Get-Content -Path <File> | foreach {& "C:\Program Files\Notepad++\notepad++" $_}