If I do "=Counter()" I only get this sequence: 1, 2, 3...
But I want get this: 01, 02, 03...
This is generally not needed. If MC ever writes out to filenames, it pads fields like [Episode] to two digits by default. But, yes, if you want to, you can use
=PadNumber(Counter(), 2) as suggested by MrC above.
If it is me, I'd avoid using the RegEx method MrC provided above, because it won't allow you to easily sanity-check your filenames, which could also have bad data. When I do this, I usually have a view sorted by [Filename]. Then, I select and tag all of the files from a given [Series] at once. Then, filter the view (with a Category Pane up top) to show only files from that Series, and then sub-select the seasons, and tag them.
Then, lastly, I quickly flip through the individual seasons and do:
1. Control-A
2. Type =Counter() in the [Episode] field.
3. Then, I quickly check and make sure the last Filename number matches the Episode field I just "counted".
When you do step #3, if the filename is "name 24.avi", but the Counter() only counted to episode 22, then you know you have two missing files in there. Or, if it counts to 26, then you might have some mis-labeled episodes that snuck in, or duplicates or something.
That kind of process doesn't take long at all, and it has saved me a TON of times when an errant duplicate, or mis-numbered file slipped in there. If you are absolutely, positively, certain that the [Filename] for each file is 100% correct, then the RegEdit trick might be a way to go. I'm skeptical how often you can be so certain, though. 99.98% isn't good enough, unfortunately, since issues can ripple-effect (and once you look up info in an online database, and then maybe rename the files themselves, there's no way "back" without playing and manually identifying any mis-labeled files).