Erase the Space Before a Decimal and Add a Comma
-
Hi!
I have the following line repeated in different variations in a document:
009084, Ind - 34007 630.00
I would like to add a comma and erase the space between 34007 and 630.00. The decimal number changes all over the document, so I after some research I found that (\d+.\d{1,2})\d* finds every single decimal number in my document.
I am struggling with what to write on the replace field in order to erase the space between both numbers and place a comma.
I truly appreciate any help you guys might be able to provide :)
-
If I understood the problem correctly, you want to replace the space between two those numbers with a comma. If this is the case, you could apply the following S/R regex:
Search:
(?-s)\d+,\sInd\s-\s\K(\d+)\s([\d.]+)
Replace:$1,$2Put the caret at the very beginning of the document, select just the
Regular Expressions modeand click onReplace All.Given the following data
009084, Ind - 34007 630.00 009084, Ind - 45632 123.98 009084, Ind - 98764 334.83you will get this output:
009084, Ind - 34007,630.00 009084, Ind - 45632,123.98 009084, Ind - 98764,334.83Hope this helps
-
@Marie-Palmquist I found the solution!
In the replace field I added ,/n
-
@astrosofista Thanks a million!
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