Hello everyone,
I'm new at N++, it is an amazing and useful program. But since I'm new i don't know how to use many options of it, and i'm not familiarized with the commands, yet.
So, my question is, if i have a list, for example:
O
O
O
O
How do i replace the O for ON+1, for example:
O1
O2
O3
O4
I've been trying to do this but i still can't, I also searched through the forum and i didn't find anything.
Any kind of help would be highly appreciated.
Thank you!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It might not be what you want, but you can insert sequences of numbers using the column editor, with leading zeros if you want. See http://notepad-plus.wiki.sourceforge.net/FAQ , under the heading "Does Notepad++ support column mode selection?"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure exactly how to do this operation in N++, but there's an easy enough work around.
From my understanding you want to change
0 01 0N+1
0 02 0N+2
0 -> 03 -> 0N+3
0 04 0N+4
You need some sort of spreadsheet program for the work around I have in mind though. Inside the spreadsheet program, make one column of 0's, then the next column start with 1 then 2 below, and drag until you have as many as you want.
Then copy both columns into N++, find and replace the space in between with blank. To accomplish this, put a space in the find box, and leave the replace box blank.
That will put your columns together.
Next, simply find and replace the 0 with the "0N+".
If your numbers go over 10 though, you'll have to be careful and go back and edit those. Or if there's too many of them, you can probably do a wild card beginning of line replace.
Now that I think of it, you can possibly do a beginning of line wild card replace to not have to worry about the x*0's. I am not too familiar with those commands myself, but I think there is a way to not have everything after a certain amount of characters replaced.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What the hello are you trying to say? I really don't understand what you are trying to explain here... And there's really no need for that.
There is an option in TextFX to hide all lines that do not contain the "0 " text, if there are lines without at all.
If the 0's aren't at the start of the line, you could _copy_ them there doing a regex replace.
Find: ^([^0]+0 .*)$
Replace by: ^0#\1
This will copy the 0 and the # identifier/separator to the start of the line.
Now all you have to do is select all those lines starting with 0#:
- move the cursor to the first or last line, between the 0 and #.
- keep down the Shift button and move the cursor to the last or first line
- while keeping down the Shift button, press the Alt button, too, and the Cursor Right button to select the # column.
- release all buttons
- press Alt+C to open the Column Editor
- select the option to insert numbers and the option to insert leading zeroes
I guess that should do it, if you hadn't already found that out by yourself. Something similar is in the instructions I referred to before.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That is only part of the trick, if the numbers 0 can be _anywhere_ on a line.
Now you have to replace the 0 in the line by the number at the start of it. Assuming there wasn't any digit at the start of any line before, you can use the following regex to move the number at the start of the line to the (first) 0 in the line.
Find:
^(\d+)([^0]+)0 (.*)$
Replace by:
\2\1 \3
This will put the first number and a space character at the position of the "0 ".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everyone,
I'm new at N++, it is an amazing and useful program. But since I'm new i don't know how to use many options of it, and i'm not familiarized with the commands, yet.
So, my question is, if i have a list, for example:
O
O
O
O
How do i replace the O for ON+1, for example:
O1
O2
O3
O4
I've been trying to do this but i still can't, I also searched through the forum and i didn't find anything.
Any kind of help would be highly appreciated.
Thank you!
It might not be what you want, but you can insert sequences of numbers using the column editor, with leading zeros if you want. See http://notepad-plus.wiki.sourceforge.net/FAQ , under the heading "Does Notepad++ support column mode selection?"
Take a look here, to see what you can do:
"Preparing numbers to be sorted by TextFX sort" (Plugin Development forum)
http://sourceforge.net/forum/forum.php?thread_id=2011755&forum_id=482781
This thread may also contain some useful or interesting information:
"Help deletin dupe words/lines and sorting"
http://sourceforge.net/forum/forum.php?thread_id=2105317&forum_id=331754
I'm not sure exactly how to do this operation in N++, but there's an easy enough work around.
From my understanding you want to change
0 01 0N+1
0 02 0N+2
0 -> 03 -> 0N+3
0 04 0N+4
You need some sort of spreadsheet program for the work around I have in mind though. Inside the spreadsheet program, make one column of 0's, then the next column start with 1 then 2 below, and drag until you have as many as you want.
Then copy both columns into N++, find and replace the space in between with blank. To accomplish this, put a space in the find box, and leave the replace box blank.
That will put your columns together.
Next, simply find and replace the 0 with the "0N+".
If your numbers go over 10 though, you'll have to be careful and go back and edit those. Or if there's too many of them, you can probably do a wild card beginning of line replace.
Now that I think of it, you can possibly do a beginning of line wild card replace to not have to worry about the x*0's. I am not too familiar with those commands myself, but I think there is a way to not have everything after a certain amount of characters replaced.
What the hello are you trying to say? I really don't understand what you are trying to explain here... And there's really no need for that.
There is an option in TextFX to hide all lines that do not contain the "0 " text, if there are lines without at all.
If the 0's aren't at the start of the line, you could _copy_ them there doing a regex replace.
Find: ^([^0]+0 .*)$
Replace by: ^0#\1
This will copy the 0 and the # identifier/separator to the start of the line.
Now all you have to do is select all those lines starting with 0#:
- move the cursor to the first or last line, between the 0 and #.
- keep down the Shift button and move the cursor to the last or first line
- while keeping down the Shift button, press the Alt button, too, and the Cursor Right button to select the # column.
- release all buttons
- press Alt+C to open the Column Editor
- select the option to insert numbers and the option to insert leading zeroes
I guess that should do it, if you hadn't already found that out by yourself. Something similar is in the instructions I referred to before.
That is only part of the trick, if the numbers 0 can be _anywhere_ on a line.
Now you have to replace the 0 in the line by the number at the start of it. Assuming there wasn't any digit at the start of any line before, you can use the following regex to move the number at the start of the line to the (first) 0 in the line.
Find:
^(\d+)([^0]+)0 (.*)$
Replace by:
\2\1 \3
This will put the first number and a space character at the position of the "0 ".