A file contains lines with numbers. These numbers are used in other files.
I want to change the numbering.
File A:..................File B:..................File C:
DG_111_aaa........DG_111_aaa........DG_112_bbb
DG_112_bbb
DG_113_bbb
New numbers:
File A:..................File B:.................File C:
DG_101_aaa........DG_101_aaa........DG_102_bbb
DG_102_bbb
DG_103_bbb
change the sequence numbers contained in a line
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
change the sequence numbers contained in a line
Thank you!
Ciao.
P.S. I'm sorry for my english .... but i try
Ciao.
P.S. I'm sorry for my english .... but i try
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
I am sorry, was an incomplete example
File A:..................File B:..................File C:
DG_109_aaa........DG_109_aaa........DG_109_bbb
DG_110_bbb........DG_110_aaa........DG_110_bbb
DG_111_bbb........DG_111_aaa........DG_111_bbb
New numbers:
File A:..................File B:.................File C:
DG_119_aaa........DG_119_aaa........DG_119_bbb
DG_120_bbb........DG_120_aaa........DG_120_bbb
DG_121_bbb........DG_121_aaa........DG_121_bbb
File A:..................File B:..................File C:
DG_109_aaa........DG_109_aaa........DG_109_bbb
DG_110_bbb........DG_110_aaa........DG_110_bbb
DG_111_bbb........DG_111_aaa........DG_111_bbb
New numbers:
File A:..................File B:.................File C:
DG_119_aaa........DG_119_aaa........DG_119_bbb
DG_120_bbb........DG_120_aaa........DG_120_bbb
DG_121_bbb........DG_121_aaa........DG_121_bbb
Thank you!
Ciao.
P.S. I'm sorry for my english .... but i try
Ciao.
P.S. I'm sorry for my english .... but i try
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
I'm assuming the middle digits 0, 1 and 2 are to be increased by 1:
Use conditional expressions:
This sort of thing is much more simply done with a script.
Use conditional expressions:
Search for conditional expression in WildEdit's help and choose Extended Format String Syntax.Search for: DG_([0-9])(?:(0)|(1)|(2))([0-9])_
[X] Regular expression
Replace with: DG_${1}(?2(1):?3(2):?4(3))${5}_
[ ] Literal replacement [i.e., not selected]
Options
Regular expression syntax
[X] Perl/ECMAScript
Replacement format syntax
[X] Extended
This sort of thing is much more simply done with a script.
last case, if I can...
generally, if I want to increase or decrease the sample numbers of 2 ???
File A:..................File B:..................File C:
DG_108_aaa........DG_108_aaa........DG_108_bbb
DG_109_aaa........DG_109_aaa........DG_109_bbb
DG_110_bbb........DG_110_aaa........DG_110_bbb
DG_111_bbb........DG_111_aaa........DG_111_bbb
Increase of 2
New numbers:
File A:..................File B:.................File C:
DG_110_aaa........DG_110_aaa........DG_110_bbb
DG_111_bbb........DG_111_aaa........DG_111_bbb
DG_112_bbb........DG_112_aaa........DG_112_bbb
DG_113_bbb........DG_113_aaa........DG_113_bbb
generally, if I want to increase or decrease the sample numbers of 2 ???
File A:..................File B:..................File C:
DG_108_aaa........DG_108_aaa........DG_108_bbb
DG_109_aaa........DG_109_aaa........DG_109_bbb
DG_110_bbb........DG_110_aaa........DG_110_bbb
DG_111_bbb........DG_111_aaa........DG_111_bbb
Increase of 2
New numbers:
File A:..................File B:.................File C:
DG_110_aaa........DG_110_aaa........DG_110_bbb
DG_111_bbb........DG_111_aaa........DG_111_bbb
DG_112_bbb........DG_112_aaa........DG_112_bbb
DG_113_bbb........DG_113_aaa........DG_113_bbb
Thank you!
Ciao.
P.S. I'm sorry for my english .... but i try
Ciao.
P.S. I'm sorry for my english .... but i try
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm