Working with multiple files Find, increment +1, replace

General questions about using WildEdit

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
garymca
Posts: 1
Joined: Fri Mar 28, 2008 7:01 pm
Location: Texas

Working with multiple files Find, increment +1, replace

Post by garymca »

Dear forum,

26 identical files (file1.txt - file26.txt) Same word in eack file "example00"

How to change the word in each file to a different value for each file?

file#1 example00 to example01
file#2 example00 to example02
file#3 example00 to example03
.
.
.
all in one pass :?
GaryC
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

The short of it, you can't do it.

You might be able to get close with \i as your replacement which will allow it to count what replacement it is on. It won't take a formatting operation though so you wouldn't get the preceding 0 and if numbering doesn't start at 1 then you'd have to do a special case of 0.

It doesn't sound like that applies here but for future users searching the boards, if you are attempting to address columns of an array 0-x, be aware that you'd need to hand code the 0 and \i would catch the 1-x case.
I choose to fight with a sack of angry cats.
Post Reply