I'm working on a plain text configuration file that has a configuration key format of

<type name>_<#>_<Subcomponent name>=<value>

To be a little more clear, the configuration file refers to a group of computers, so the type name could be COMPUTER, and subcomponent name could be IP or PORT, for instance. So I have a block of keys for computer 1 and its subcomponents, a block for computer 2, etc throughout the file.

Adding a single new block of keys is relatively easy, but adding multiple blocks becomes a tedious column selecting exercise. Since the type name is the same length throughout the file, I want to be able to do a column select through all the numbers that need changing, and quickly increment them. I don't see anything in TextFX that will do this, which would be the obvious option. Is there another way to do this quickly and easily?

As a side note, I know I could write a Perl script to do this, but it'd be a little to indiscriminate as I don't want to increment all numbers, just a group of them.

link|improve this question

feedback

2 Answers

You may have to do it in batches (if your number column isn't zero padded to a constant width) but you can use column-selection (just tested working as of notepad++ 5.9.3) to select just the numbers, then use Edit->Column Editor (Alt-C) to set your start and end numbers.

This may not be much help either, if your numbers are neither zero-padded nor ordered, but hopefully it will be some help.

link|improve this answer
Ooh, so close. The number needs to be repeated through the various sub-components. I'll edit the question to be a little clearer about what I want. – MBraedley Oct 18 '11 at 19:04
feedback

If you paste to excel a text in witch line contains tabs separators, you'll get a useful sheet; so:

  • replace space with TAB chars using extended search (replace "_" and "=" with "\t")
  • copy and paste to excel, renumber the column content
  • copy and paste back to notepad++
  • replace tab with "_" and restore the "=" column typing into a rectangular selection (ALT+mouse selection) 1 char width.
link|improve this answer
This probably does the trick, but it's just as much work as @GeminiDomino answer. The point of the question is to do one or two clicks after the column select. See this question for why your solution isn't so nice. – MBraedley Oct 19 '11 at 17:52
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.