adding incremental number between ' '
-
'13': type: SHOP id: SPRUCE_WOOD buy-price: 200.0 '14': type: SHOP id: BIRCH_LOG buy-price: 200.0 '15': type: SHOP id: BIRCH_WOOD buy-price: 200.0 '16': type: SHOP id: JUNGLE_LOG buy-price: 200.0 '17': type: SHOP id: JUNGLE_WOOD buy-price: 200.0 '18': type: SHOP id: ACACIA_LOG buy-price: 200.0 '19': type: SHOP id: ACACIA_WOOD buy-price: 200.0 '20': type: SHOP id: DARK_OAK_LOG buy-price: 200.0 '21': type: SHOP id: DARK_OAK_WOOD buy-price: 200.0 '22': type: SHOP id: SPONGE buy-price: 260.0 '23': type: SHOP id: BRICKS buy-price: 270.0 '24': type: SHOP id: WHITE_WOOL buy-price: 320.0I would like to be able to replace all the numbers inside the ‘0-1000’
-
Hello, @speedrider and All,
Here is my solution :
From your text :
'13': type: SHOP id: SPRUCE_WOOD buy-price: 200.0 '14': type: SHOP id: BIRCH_LOG buy-price: 200.0 '15': type: SHOP id: BIRCH_WOOD buy-price: 200.0 '16': type: SHOP id: JUNGLE_LOG buy-price: 200.0 '17': type: SHOP id: JUNGLE_WOOD buy-price: 200.0 '18': type: SHOP id: ACACIA_LOG buy-price: 200.0 '19': type: SHOP id: ACACIA_WOOD buy-price: 200.0 '20': type: SHOP id: DARK_OAK_LOG buy-price: 200.0 '21': type: SHOP id: DARK_OAK_WOOD buy-price: 200.0 '22': type: SHOP id: SPONGE buy-price: 260.0 '23': type: SHOP id: BRICKS buy-price: 270.0 '24': type: SHOP id: WHITE_WOOL buy-price: 320.0Do this regex S/R :
-
SEARCH
\R(?!\h*')|('\d+') -
REPLACE
?1'':| -
Select the
Regular expressionsearch mode
You should get this text :
'':| type: SHOP| id: SPRUCE_WOOD| buy-price: 200.0 '':| type: SHOP| id: BIRCH_LOG| buy-price: 200.0 '':| type: SHOP| id: BIRCH_WOOD| buy-price: 200.0 '':| type: SHOP| id: JUNGLE_LOG| buy-price: 200.0 '':| type: SHOP| id: JUNGLE_WOOD| buy-price: 200.0 '':| type: SHOP| id: ACACIA_LOG| buy-price: 200.0 '':| type: SHOP| id: ACACIA_WOOD| buy-price: 200.0 '':| type: SHOP| id: DARK_OAK_LOG| buy-price: 200.0 '':| type: SHOP| id: DARK_OAK_WOOD| buy-price: 200.0 '':| type: SHOP| id: SPONGE| buy-price: 260.0 '':| type: SHOP| id: BRICKS| buy-price: 270.0 '':| type: SHOP| id: WHITE_WOOL| buy-price: 320.0|-
Now place the caret between the first
''zone -
Open the Column editor (
Alt + C) and renumber as you like -
Don’t forget to tick the
Leading zerosoption
For instance, we could end with this text :
'01':| type: SHOP| id: SPRUCE_WOOD| buy-price: 200.0 '02':| type: SHOP| id: BIRCH_LOG| buy-price: 200.0 '03':| type: SHOP| id: BIRCH_WOOD| buy-price: 200.0 '04':| type: SHOP| id: JUNGLE_LOG| buy-price: 200.0 '05':| type: SHOP| id: JUNGLE_WOOD| buy-price: 200.0 '06':| type: SHOP| id: ACACIA_LOG| buy-price: 200.0 '07':| type: SHOP| id: ACACIA_WOOD| buy-price: 200.0 '08':| type: SHOP| id: DARK_OAK_LOG| buy-price: 200.0 '09':| type: SHOP| id: DARK_OAK_WOOD| buy-price: 200.0 '10':| type: SHOP| id: SPONGE| buy-price: 260.0 '11':| type: SHOP| id: BRICKS| buy-price: 270.0 '12':| type: SHOP| id: WHITE_WOOL| buy-price: 320.0|Now, use this simple regex S/R to get your initial list :
SEARCH
\|REPLACE
\r\nfor Windows files OR\nfor Unix files'01': type: SHOP id: SPRUCE_WOOD buy-price: 200.0 '02': type: SHOP id: BIRCH_LOG buy-price: 200.0 '03': type: SHOP id: BIRCH_WOOD buy-price: 200.0 '04': type: SHOP id: JUNGLE_LOG buy-price: 200.0 '05': type: SHOP id: JUNGLE_WOOD buy-price: 200.0 '06': type: SHOP id: ACACIA_LOG buy-price: 200.0 '07': type: SHOP id: ACACIA_WOOD buy-price: 200.0 '08': type: SHOP id: DARK_OAK_LOG buy-price: 200.0 '09': type: SHOP id: DARK_OAK_WOOD buy-price: 200.0 '10': type: SHOP id: SPONGE buy-price: 260.0 '11': type: SHOP id: BRICKS buy-price: 270.0 '12': type: SHOP id: WHITE_WOOL buy-price: 320.0Voila !
Best Regards,
guy038
-
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