10 Replies Latest reply on Jan 9, 2012 7:04 AM by Kirikokos

# GREP style, except code?

Hi all, I hope you can help me!

I got this table with a lot of prices, like:

299.95

99.95

13.3

9.95

40.4

12.95

My problem is, this is a huge list. And there are some prices like this > 13.3 > 40.4 > see the list I wrote

I need to put a 0 after the numbers, like this > 13.30 > 40.40

Is there a code for that?

Something like this: Find: .\$ and Change: \$00

But then It will put zeroes after all the prices.

I need a code that says: put a 0 after the numbers except after numbers ending with 5, because the other numbers ends with 5 like>

299.95

99.95

13.3

9.95

40.4

12.95

HELP!

• ###### 1. Re: GREP style, except code?

Maybe something like this:

Find: (?<=\.)(\d{1})(?!\d)

Change to: \$00

--

Marijan (tomaxxi)

http://tomaxxi.com

1 person found this helpful
• ###### 2. Re: GREP style, except code?

Kirikokos wrote:

[..] I need a code that says: put a 0 after the numbers except after numbers ending with 5, because the other numbers ends with 5 like>

Look for this:

\.\d(?!\d)

and replace with

\$00

This will add a zero to each sequence of full-stop + one single digit (not just the fives). The last part in the Find sequence is a Negative Lookahead: Find only strings where there is not another digit after the first.

1 person found this helpful
• ###### 3. Re: GREP style, except code?

Thanks! It worked...almost..

I just saw on my pricelist, that there are some numbers like these:

299.95

99.95

13.3

9.95

40.4

14

12.95

7

Any code for that?

• ###### 4. Re: GREP style, except code?

Nasty ... can't find anything that works.

Marijan, your turn again!

• ###### 5. Re: GREP style, except code?

Maybe...

First of all, changing all the one digit numbers with .00

and then use your code.

But what is the code for that?

• ###### 6. Re: GREP style, except code?

Hmm...

Maybe something like this:

Find: (?<!\.)\<(\d+)\>(?!\.)

Change: \$0.00

• ###### 7. Re: GREP style, except code?

YES!

IT works!

(?<!\.)\<(\d+)\>(?!\.)

\$0.00

This code for the number missing .00

7 > 7.00

--------------------------------------------------------

\.\d(?!\d)

\$00

and jonwares code for numbers missing .0

13.3 > 13.30

Thanks

• ###### 8. Re: GREP style, except code?

Hi again

Do you have a quick code for putting a zero before a number? There are some numbers like these in the list:

.90

.80

>>

0.90

0.80

Thank you guys!

• ###### 9. Re: GREP style, except code?

Quick code:

Find: (?<!\d)\.\d+

Change: 0\$0

--

Marijan (tomaxxi)

http://tomaxxi.com

• ###### 10. Re: GREP style, except code?

SO QUICK!

THANKS!