My problem is that i need to add to number="2000" 700 so it would be number="2700" and number="2001" would be number="2701". So you get the point.
And there are 4000 numbers i need to change so is there any way to do that easily with notepad++ replace?
Thks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your data may not be suitable, but another option is to try reading the file into something like MS Excel. If you tell it that the delimiters are " then it might be able to get those numbers into columns you can operate on.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can try to align the numbers so you can column select them and use the column editor with incremental number replace (works very well in resource files ;]), but since its 100k lines expect poor performance (if you get to select it as a column that is, the 'something' wil probably make it hard, although you can try to temporarily add a tab infront of the number and set the tabsize high)
I suppose your file has been generated, maybe you can get another regenerated copy with corrected numbers?
php?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have a little problem, I've got a file with 100k lines and there are lines like:
<something number="2000" id="312">
..
...
..
..
<something number="2001" id="312">
My problem is that i need to add to number="2000" 700 so it would be number="2700" and number="2001" would be number="2701". So you get the point.
And there are 4000 numbers i need to change so is there any way to do that easily with notepad++ replace?
Thks
Your data may not be suitable, but another option is to try reading the file into something like MS Excel. If you tell it that the delimiters are " then it might be able to get those numbers into columns you can operate on.
Don't think so.
You can try to align the numbers so you can column select them and use the column editor with incremental number replace (works very well in resource files ;]), but since its 100k lines expect poor performance (if you get to select it as a column that is, the 'something' wil probably make it hard, although you can try to temporarily add a tab infront of the number and set the tabsize high)
I suppose your file has been generated, maybe you can get another regenerated copy with corrected numbers?
php?
Use AWK or GAWK for this.
Here is the corresponding AWK program:
BEGIN {
ITEM_COUNT = 100
START_NUMBER = 2700
FMT = "<something number=\"%ld\" id=\"312\">\n"
for (i = 0; i < ITEM_COUNT; i++) {
printf(FMT, i + START_NUMBER)
}
}
Also you can use
printf(FMT, i + START_NUMBER) > "file.txt"
in order to print generated string to file "file.txt"