I want to replace a number with successive numbers, starting at 1 and going up.

Posted by Pär-Magnus Green on Super User See other posts from Super User or by Pär-Magnus Green
Published on 2010-05-19T03:25:40Z Indexed on 2010/05/19 3:32 UTC
Read the original article Hit count: 214

Filed under:
|

I'm aware that this is something people can easily program, but I'm not familiar with those things, so I was hoping there was an easier solution.

I've edited a large database of questions, including sorting, and ended up getting all the question ID's mixed up.

I'm trying to do this in Notepad++, but any other suggestions are welcome. I'm wondering if there's a way to search for a string (ex. "Question[any number]") and replace the numbers with first 1, then 2, et.c.

For clarification, this is how one question looks like:

TriviaBot_Questions[3]['Question'][63] = "Acronyms: What does WTT stand for?";  
TriviaBot_Questions[3]['Answers'][63] = {"Want To Trade"};  
TriviaBot_Questions[3]['Category'][63] = 7;  
TriviaBot_Questions[3]['Points'][63] = 1;
TriviaBot_Questions[3]['Hints'][63] = {};  

and the next question, as is now, is not followed by 64. It might be 245 or 1029, and regardless of which number it is, I want it replaced with "previous number + 1", basically.

© Super User or respective owner

Related posts about find-and-replace

Related posts about lua