Dinesh
Dinesh

Reputation: 1

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

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.sstatic.net/v3Ff2.png [2]: https://i.sstatic.net/W4RYP.png

Upvotes: 0

Views: 105

Answers (1)

JvdV
JvdV

Reputation: 75840

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.

Upvotes: 2

Related Questions