TransWikia.com

Is there is any way i could align columns based on unique text using notepad++ or any means?

Stack Overflow Asked on December 30, 2021

My file has thousands of line like this
[enter image description here][1]


`<userdata ID="11010014"    PRI="1" Locator="Class_abc"   DATA="5 "/>
<userdata ID="11010014"  PRI="1"  Locator="Class_abcde  DATA="5 "/>
<userdata ID="11010014"   PRI="1" Locator="Class_ab"    DATA="5 "/>
<userdata ID="11010014" PRI="1"  Locator="Class_primary " DATA="5 "/>`

i have to align all the fields properly like this what to do help me.

[enter image description here][2]

`<userdata ID="11010014" PRI="1" Locator="Class_abc"       DATA="5 "/>
 <userdata ID="11010014" PRI="1" Locator="Class_abcde"     DATA="5 "/>
 <userdata ID="11010014" PRI="1" Locator="Class_ab"        DATA="5 "/>`

ID length is constant
[1]: https://i.stack.imgur.com/v3Ff2.png
[2]: https://i.stack.imgur.com/W4RYP.png

One Answer

Maybe this could be helpful


Step 1) search for:

h+(?!ID=|")

Replace with:

t

See the online demo


The pattern matches:

  • h+ - At least a single horizontal whitespace character.
  • (?!ID=|") - Negative lookahead for either literally 'ID=' or '"'.

Step 2):

  • Click Plugins > Plugins Admin
  • Tick 'Elastic Tabstops' and hit Install

As soon as it's installed you'll notice it will auto-allign the tabs we just inserted.

Answered by JvdV on December 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP