- AuthorPosts
- February 26, 2012 at 11:20 am #10081userParticipant
hello!
I want to number the lines of a text file, by inserting 1), 2), 3), etc at the begining of each line
how can this be done?
thanks!
February 26, 2012 at 1:03 pm #10082webernMemberYou can use Insert Sequence Numbers plug-in (32-bit)
or a .jsee-macro like this one:
var n = document.GetLines();
var a = new Array();
for (var i=1; i<(n+1); i++) a.push(i + ") " + document.GetLine(i));
document.selection.SelectAll();
document.write(a.join(“n”));
Quit();February 26, 2012 at 7:21 pm #10086StefanParticipanta) make an zero-width selection in front of the lines
b) execute “Edit > Advanced > Numbering…”
c) press [OK]
Note: to pad with zeros enter them into the “First Line” field like “01” or “0001”d) while still have that inserted numbers selected do an regex s&r:
Find: (dd)
Replace with: 1)[X]Use regex
[X]In selection onlyNote: the amount of find “d” patterns depends on how many zeros you have padded.
“dd” will match two digits.
“ddd” or “d{3}” will match three, and so on… - AuthorPosts
- You must be logged in to reply to this topic.