Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Delete space after number in tables

New Here ,
Mar 08, 2023 Mar 08, 2023

I need to convert all my numbers from what I think is the french way to American/English.
Ex:
1 023 696 Correct 1,023,696
0,04 correct 0.04

I've found a Grep style converting all space to, that's brilliant, except that all my numbers have a space at the end so I end up with a comma at the end as well...

 

Does anyone know how I can delete space after a number in a table cell?

TOPICS
How to , Type
909
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 3 Correct answers

Community Expert , Mar 08, 2023 Mar 08, 2023

Find

\h(?=\d{3})

 

This finds any horizontal space - looks ahead for 3 digits

 

Technically

1 00 - won't work

1 000 replaced by 1,000

1 000 000 replace by 1,000,000

and so on

 

The other grep would be

(\d),(\d{2})

$1.$2

 

Translate
Community Expert , Mar 09, 2023 Mar 09, 2023

GREP looks for patterns - so if the pattern doesn't fit you need another pattern.

 

It might be possible - you'd have to give examples of live text to test fully.

Translate
Community Expert , Mar 09, 2023 Mar 09, 2023

Space-comma replacement:

Find what: \d\K\h(?=\d\d\d)
Change to: ,

 

Translate
Community Expert ,
Mar 08, 2023 Mar 08, 2023

Find

\h(?=\d{3})

 

This finds any horizontal space - looks ahead for 3 digits

 

Technically

1 00 - won't work

1 000 replaced by 1,000

1 000 000 replace by 1,000,000

and so on

 

The other grep would be

(\d),(\d{2})

$1.$2

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 08, 2023 Mar 08, 2023

Thanks! It almost works like magic! Some numbers like 156 have a space in front and end up ,156. Anyway to get around that?

The other grep works perfectly!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 09, 2023 Mar 09, 2023

GREP looks for patterns - so if the pattern doesn't fit you need another pattern.

 

It might be possible - you'd have to give examples of live text to test fully.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 09, 2023 Mar 09, 2023
LATEST

Space-comma replacement:

Find what: \d\K\h(?=\d\d\d)
Change to: ,

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines