Seatch text file add leading 0 to single digit number
-
I have a text file that I export form a database program but does not allow a leading 0 on a single digit number so when I sort them it looks like this
Title Volume
Book1 1
Book10 10
Book2 2Ive been manually seach and replace 1 with 01 2 with 02 etc but i was wondering if anyone could tell me a better way to replace all the numbers 1 to 9 with 01 to 09
thanks in advance
Rich -
You could try something like this (be sure to check Regular expression in the Replace dialog):
Find what: ([^0-9])([0-9][^0-9]) Replace with: \10\2It finds any character that is NOT in the set [0…9] followed by a character that is, followed by any character that is not. That gets replaced by the first character found, a “0”, and the last 2 characters that were found.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login