Though you can do this, you'll need to perform two search & replace passes: one 
for each value pair.

Find:      ^(\d+?)\.1

Replace:   \1.33

and 

Find:      ^(\d+?)\.2

Replace:   \1.67


Regards,

 Patrick Woolsey
==
Bare Bones Software, Inc.             <https://www.barebones.com/>


> On Mar 16, 2022, at 13:02, Howard <[email protected]> wrote:
> 
> I have a column of numbers; some have a decimal value. Some numbers end with 
> `.1` and some end with `.2`. If a number's decimal part contains `.1` I want 
> to change its ending to `.33`, but keep its whole number the same, so 1.1 
> would become 1.33. Also,  if a  number's decimal part contains `.2` I want to 
> change its ending to `.67`, but keep its whole number the same, so 1.2 would 
> become 1.67.
> 
> As the column can have hundreds of rows, using Grep is there an easy way to 
> convert the decimal portion of a number that ends with either .1 or .2 while 
> retaining the whole number part?
> 
> Howard
> 
> Sample      Desired output
> 0.2                    0.67
> 1.1                    1.33
> 1.1                    1.33
> 1.2                    1.67
> 1.1                    1.33
> 6                        6
> 3.2                     3.67
> 8                        8
> 6.2                     6.67
> 

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/6E4EFDEA-DA2D-432C-827A-C8FC6B4ADF2C%40barebones.com.

Reply via email to