如何在Notepad++中对齐行?

huangapple go评论59阅读模式
英文:

How to align the lines in notepad++

问题

<Parameter Name="FilePath" Value="/Test_01/path_01/vendor/dev/outbound"/>
<Parameter Name="FileName" Value="*.txt"/>
<SubParameter Name="HostIP" Value="192.165.10.5"/>
<SubParameter Name="UserId" Value="win-001"/>

英文:

Experts,

I have 1000's of lines captured from the xml file in below format in notepad++.

sample text
  &lt;Parameter Name=&quot;FilePath&quot; Value=&quot;/Test_01/path_01/vendor/dev/outbound&quot;/&gt;
&lt;Parameter Name=&quot;FileName&quot; Value=&quot;*.txt&quot;/&gt;
	    &lt;SubParameter Name=&quot;HostIP&quot; Value=&quot;192.165.10.5&quot;/&gt;
	    &lt;SubParameter Name=&quot;UserId&quot; Value=&quot;win-001&quot;/&gt;

But I want to resize all the 1000's of lines in below format. Manually moving each line to the beginning of the line is tedious. Please assist me

&lt;Parameter Name=&quot;FilePath&quot; Value=&quot;/Test_01/path_01/vendor/dev/outbound&quot;/&gt;
&lt;Parameter Name=&quot;FileName&quot; Value=&quot;*.txt&quot;/&gt;
&lt;SubParameter Name=&quot;HostIP&quot; Value=&quot;192.165.10.5&quot;/&gt;
&lt;SubParameter Name=&quot;UserId&quot; Value=&quot;win-001&quot;/&gt;

答案1

得分: 2

在Notepad++中使用菜单 => 编辑 => 空白操作 => 修剪前导空格

英文:

In Notepad++ use menu => Edit => Blank Operations => Trim Leading Space.

答案2

得分: 1

做一个查找/替换。将此输入到“查找内容”框中:

^\s+

而在“替换为”框中不输入任何内容。

查找一行开头的一个或多个空白字符,并替换为空,有效地删除它们。

英文:

Do a find/replace. enter this in the Find What box:

^\s+

And nothing in the Replace with box.

Find one or more whitespace characters at the beginning of the line and replace with null, effectively deleting them.

答案3

得分: 1

另一种选择是使用<kbd>Ctrl</kbd>+<kbd>A</kbd>来选择所有文本,然后按<kbd>Shift</kbd>+<kbd>Tab</kbd>几次(或按住)来减少缩进(包括空格和制表符)。

英文:

Another option is <kbd>Ctrl</kbd>+<kbd>A</kbd> to select all text and hit <kbd>Shift</kbd>+<kbd>Tab</kbd> several times (or hold) to reduce indent (both space and tab symbols).

huangapple
  • 本文由 发表于 2023年3月31日 03:22:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/75892199.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定