Reputation: 1
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.
`<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
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):
As soon as it's installed you'll notice it will auto-allign the tabs we just inserted.
Upvotes: 2