Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Grep find & change decimal and thousands

$
0
0

Hi All,

 

I want to find a digits some of types using with grep in single find and change

 

(1) First type comma(,) for decimal and space for thousands and ten thousands

1 100 406,50

 

(2) Second type dot(.) for decimal and comma for thousands and ten thousands

1,100,406.50

 

(3) Third type comma(,) for decimal and dot for thousands and ten thousands

1.100.406,50

 

for all these i am finding multiple number of times with combination of numbers

 

my code:

app.findGrepPreferences.findWhat = "([0-9])\\.([0-9]{2})";

app.changeGrepPreferences.changeTo = "$1,$2";

app.changeGrep();

app.findGrepPreferences = app.changeGrepPreferences = null;

 

app.findGrepPreferences.findWhat = "([0-9]{3})\\.([0-9]{3})";

app.changeGrepPreferences.changeTo = "$1 $2";

app.changeGrep();

app.findGrepPreferences = app.changeGrepPreferences = null;

 

app.findGrepPreferences.findWhat = "([0-9])\\.([0-9]{3})";

app.changeGrepPreferences.changeTo = "$1 $2";

app.changeGrep();

app.findGrepPreferences = app.changeGrepPreferences = null;

 

app.findGrepPreferences.findWhat = "([0-9])\\.([0-9]{3})\\.([0-9]{3})\\.([0-9]{2})";

app.changeGrepPreferences.changeTo = "$1 $2 $3,$4";

app.changeGrep();

app.findGrepPreferences = app.changeGrepPreferences = null;

 

app.findGrepPreferences.findWhat = "([0-9]) ([0-9]{3}) ([0-9]{3})\\.([0-9]{2})";

app.changeGrepPreferences.changeTo = "$1 $2 $3,$4";

app.changeGrep();

app.findGrepPreferences = app.changeGrepPreferences = null;

 

 

but i want to find each type in a single find and change, could any one help

 

thanks in advance

steve


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>