Adding +1 to a value

Find, replace, find in files, replace in files, regular expressions

Adding +1 to a value

Postby bccsrc » Fri Aug 11, 2006 6:05 pm

Hello this is my first post. Please be nice to me.... :D

I would like to create a list of information and be able to add +1 to each number.

So something like this:

test1
test2
test3

currently I would have:
test1
test1
test1

My list has 200 lines in it and I'm looking for an easy way to increment test1 to test2.

Thanks for your help and I hope this makes sense.

Brandon
User avatar
bccsrc
Newbie
 
Posts: 1
Joined: Thu Aug 10, 2006 11:00 pm

Re: Adding +1 to a value

Postby Mofi » Sat Aug 12, 2006 9:31 am

No problem. First you have to select the column with the number. You have 3 possibilities:

1) Set the cursor to 1 in the first line after test, look at the status bar for the current line number and column number and use Edit - Select Range with appropriate values to select the column for 200 lines.

2) Switch with Alt+C or menu item Column - Column Mode to the column mode and select the number column in the 200 lines with the mouse.

3) Switch with Alt+C or menu item Column - Column Mode to the column mode and select the number column in the 200 lines with the cursor keys UP, DOWN, RIGHT, LEFT, PGUP, PGDN, ... while holding the SHIFT key.

After you have selected the number column you only have to execute Column - Insert Number with the values you need.

If you can't see a menu named Column you currently use the Basic menu. Click with right mouse button on the menu bar and select Advanced to switch to the Advanced menu.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Find/Replace/Regular Expressions