Add commas to financial numbers using GREP

Hi all!

Using InDesign CC for this. This is the type of financial numbers that I do business with - $79605.01 - with more than 4 k that I add commas 1 or 2 according to the number. Final result should look like this - $79,605.01-

So far, use GREP I in the FIND WHAT box \$[.,\d]+ and he tries to find them.  What am I missing or unable to, is what to put in the CHANGE TO box. I tried to \1$, but it does not work.

I have need FIND WHAT already because what I have works well. I just need the script so that it will add commas to the appropriate locations. Search Google gave me a lot of answers on how to 'find' the numbers, but missing of course in the Department of "set up".

No a kind soul help?

Steph

Your GREP expression returns the integer, which is not helpful in this case. I'm not all that an expert in complex GREP, but I don't see a way to do this only once with a number of variable length, so if you have cases for 1 and 2 required commas, I think you need two expressions and they need run in the correct order.

(First of all find \d(?=\d{6}\.\d) and change to $0, which will add the comma to millions, then find \d(?=\d{3}\.\d) and change to $0, to add the comma for thousands. These expressions only work if there is a decimal number

Tags: InDesign

Similar Questions

  • Erase the numbers using GREP?

    Hi guys,.

    Could someone help me please? I only find GREP in inDesign if Im not that clued up on it. I searched the web, but can't seem to find a way to remove the numbers from sequntial a document - is it possible?

    I essentially several documents containing some old page numbers in parentheses - is possible to use GREP to search and delete, including the media? That is to say, [1], [2], [3], etc.

    Thank you!

    Hello

    [Of course, try this: \[\d+\]

    This will find any number of numbers in brackets, including the media.

    Hope that helps.

    --

    Marijan (tomaxxi)

    http://tomaxxi.com

  • Use Grep to add superscrpt style symbol character $

    I have a style of object which, among other things, apply a style of papragraph, in this paragraph style, I want to use GREP to find any instance of $, and apply a character style

    the problem I have is that it seems not recogize the symbol $

    In GREP, you must escape the symbol $ . Use: \$

    @+

    Marc

  • Use Grep to find/replace

    I'm trying to find how to use GREP in find/replace of chage the formatting of a text which is a spreadsheet.

    I worked on the GREP query "~ b (\d\d) ~ b ', which is a paragraph return, followed by two digits, followed by another paragraph of return

    and then it is replaced by ' \t $1 ~ b ', which is a tab, found two numbers and a paratrooper returned.

    What I have to do is change the query to search for ANY number of digits, (which may be delimited by commas: e.g. 23, 36, 48, 50), then replace with a tab + found text.

    I guess what I'm looking for is a way for the query find "any text between two paragraph returns, no matter what that length", but I don't know how to do this. All of the generic options seem to find a single exampler (a figure, a character etc.)

    And you came so far

    Repetition operators are? (zero or one), * (zero or more) and + (one or more times). You can also specify the exact number: {at least up to the}.

    All of these operators are "greedy" by default - they match as much as possible. To to match as less as possible (which I'm sure you will come, sooner or later), add another? After the expression of repeat.

    If this is a number, then possibly another (which will be always included):

    \D\d?

    and what a figure, then zero or as much as 9999999,93856 million:

    \D\d*

    which is functionally identical

    \d+

    And it is between 3 and 8 figures but will be forced to use the shortest possible match:

    \d{3,8}?

    Having said that: a quick & dirty solution for your real problem is to find any amount of numbers, spaces, and comma:

    ~ b [\d,] + ~ b

    (there are more here because otherwise it would correspond also to an empty line). The [..] a list of the hooks - it will match to any unique inside code.

    A more complicated but 'cleaner' way is looking very precisely that for many, comma, space, number sequences - it is cleaner because it lines poorly trained (comma without a space) is fried!

    (She also has another code - operators in parentheses. Look at their place in a good reference GREP - lost people are enthusiastic about Peter Kahrel O'Reilly title, because there on the use of GREP in InDesign.)

    ~b\d+(, \d+)*~b)

  • I use GREP to do this?

    I created my OCD for my book very well. In my content, the positions of each chapter are drawn using the entries in the table of contents, and then followed by its page number.

    I would like to add a word (the word "Chapter") before each entry materials in numbered. Can I use GREP styles to do this?

    I'm using CS5.

    Thank you!

    And here: InDesign Automagic to work!

    (There is a space after "Chapter").

  • Adding hyperlinks and text ankles using Grep

    Hi all

    I tried to add both a hyperlink text source and destination within my document using Grep, but I can't seem to do things. I'm looking to find the source text that has the style of paragraph "1HD" and begins with the word 'History', and then turn that into the source text for the hyperlink. Secondly, that the text "References" later to become the anchor of the text to the destination of the link. As a reference, here is what is defined:

    var myHeader = app.findGrepPreferences.appliedParagraphStyle = "1HD";
    var myHeader = app.findGrepPreferences.findWhat = "Historical \w*";
    

    as well as

    var myAnchor = app.findGrepPreferences.appliedParagraphStyle = "";
    var myAnchor = app.findGrepPreferences.findWhat = "References";
    

    I did experiment with information I could get my hands on in line, but I always feel to get an error or another. Any guidance would be greatly appreciated!

    Regards and thanks in advance.

    Julian

    Hi Julian,.

    Can useful code, below

    1 change the line 5 according to the guidelines of your paragraph Style request

    var myDoc = app.activeDocument;
    app.findGrepPreferences = app.changeGrepPreferences = null;
    
    app.findGrepPreferences.findWhat = ".+";
    app.findGrepPreferences.appliedParagraphStyle = "MN_first";
    var myFound1 = myDoc.findGrep();
    
    count = 0
    for(k=0; k
    

    To anchor text, use the code below:

    var myDoc = app.activeDocument;
    app.findGrepPreferences = app.changeGrepPreferences = null;
    
    app.findGrepPreferences.findWhat = ".+";
    app.findGrepPreferences.appliedParagraphStyle = "MN_first";
    var myFound1 = myDoc.findGrep();
    
    count = 0
    for(k=0; k
    

    Concerning

    Siraj

  • Money does not allow me to add a new financial institution

    When you try to add a new financial institution in my money program it will be me cute not TSE do.

    Please post questions MS Money on this forum:
    http://social.Microsoft.com/forums/en/money/threads

  • Add language translator we for use offline in MS Office

    I work for a nonprofit and need a translator to add language that can be used without having to go online. We must work with MS Office 2007. The reason for the offline use is, my body has mandated state confidentiality issues.

    Download on a different machine, then move it to your machine on a USB stick and install it?

    <>http://www.Microsoft.com/download/en/details.aspx?displaylang=en&ID=5780 >

    HTH,
    JW

  • How to add a voice command to use Aero flip

    Original title: Aero flip by the voice.

    I am trying to add a voice command to use Aero flip. My question is, what Windows executable actually runs when the user clicks on an icon?

    I am trying to add a voice command to use Aero flip. My question is, what Windows executable actually runs when the user clicks on an icon?

    Hello

    There is no executable file of the component Aero Flip 3D , it is started by a control system.

    You can create a shortcut for the command of Aero Flip 3D and run it with a voice command.

    See the following tutorial.

    Add and create the Flip 3D Aero shortcut:

    http://www.mydigitallife.info/add-and-create-Aero-Flip-3D-shortcut-on-desktop-quick-launch-or-Windows-7-taskbar/

    Concerning

  • Use GREP to apply paragraph styles, character styles not only

    I have a body of text, and in it, I would like to apply a specific style to the paragraphs corresponding to a model. I did a GREP style that applied some changes formatting of paragraphs, I tried that it affects, but in doing so, I found that I couldn't Center these lines using a character style. (The corresponding lines should be centered, and the rest should be left aligned.)

    I was thrilled to learn that the GREP function, then completely disappointed with this limitation. InDesign offers the possibility to automate this, so I must not cross and Center each paragraph corresponding to the hand?

    Thank you!

    InDesign provides a way to automate this so?

    Yes and no. There is no dynamically linked paragraph styles to a paragraph about his boss, but he has at least two alternatives:

    (1) use Grep-F/C

    (2) use the script FindChangeByList or MultiFindChange which is basically automate operations F/C

    HTH

    Loïc

  • How to use GREP expression to group the last two words of a paragraph?

    Hi guys, I'm dealing with a document that is riddled with the orphan and want to use GREP to get rid of them all.

    I found this thread talking about how to group all the last 10 characters. But in my language, you can have up to 4 words together (almost a third of the sentence!) and still not break the limit of 10 characters. So if I use this expression, a sentence cut in half way, which make the whole paragraph looks horrible. I also tried the (\s\w+)? $ expression, but he left a few intact orphans (No. very random, model at all).

    So is there any other expression that can make the last 2 words of any paragraph together like glue stick?

    (\H+?\h ?) {2} $

    (^/)

  • Can I use GREP to transform every fourth tab back?

    I have a huge file with tabs plus 5,000, and only every fourth tab must be changed for a return. Is this possible using GREP or ANY OTHER METHOD and pressing back another me having to manually select each fourth tab?

    This screen is pulled before running GREP? You don't mention he had already returns after the names in some places.

    You need the * after all the [^ \t] elements, but avoids the. +. [^ \t] is a negative class, that means anything that is not a tab, and the * means 0 or more times.

    And you said every fourth tab, so it's actually the tab after the postal code, and which seems to do what you ask. If you want to change the tab after the name on the first line, I this would address differently.

    Find ^(.*?\t.*?) (\t) (?!\(\d{3}\)) which means find any character at the beginning of a paragraph (if there is) followed by a tab and more characters (if there are any), then a followed by three digits in parentheses DO NOT tab, and change $ 1 which should only change the tabs after the names. It is, however to change the tab after the postal code if the following line does not begin with three digits in brackets.

    Looking at the ads, are you sure you want to change this tab for a paragraph, rather than just a forced line break return (you can do by changing to $1\n)? It depends on how your styles are implemented...

  • I have a subscription to creative cloud (at least) but I would like to add another user, who will use a Mac... is there a way I can do this?

    I have a subscription to creative cloud (at least) but I would like to add another user, who will use a Mac... is there a way I can do this?

    Hello

    You can have the creative cloud installed and signed in on two computers as long as you don't use it on one at a time. Download and install as you did on the first computer, sign in to your Adobe account on the Adobe using your Adobe ID website, download the desktop app from clouds, then download the software. Sign on a computer that should not be used: log in and log out of the desktop Adobe Creative Cloud application

    You can download the installer for Creative Cloud from here:
    Creative cloud help | Creative cloud desktop.

    After you install the creative Cloud desktop application, you will need to sign in with a login password and Adobe. Then you can install applications. This link provides more information and step by step instructions, if you need: CC help | Download, install, update or uninstall applications

  • How to add keywords to my images using DW?

    How to add keywords to my images using DW?

    Well, there is keywords, then there are "Key words", here is an example...

    .. .is completely obsolete for the reason that I suggest in this example of tag itself. There was a time, long ago in the age of darkness of web design, when the keywords meta was actually used to determine the content of the page to a certain extent. Developers immediately took advantage and started to cram what they thought in the , or even completely independent but of the popular search terms, in the hope that it would affect their classification. He did, for a time, until the more intelligent search engines and began ignoring totally the tag all together.

    "Key words" changed direction after that. Now search engines actually look at the content of your page and determine what your page is about. Keyword making rich, correspondent html text (not strange blocks of text random coma separated more) is one of the things (there are a lot of pieces for Search Engine Optimization or SEO) which determines if a person find using a word or phrase.

  • Change the paragraph of empty line using GREP style

    Hello again... another request GREP if anyone can help!

    How can I change a line of completely empty paragraph (such as those found between the verses in a poem, for example) to a style of different paragraph so I can control the space better use GREP?

    (?<=\r)\r will="" find="" a="" paragraph="" return="" preceded="" by="" a="" paragraph="" return,="" i.e.="" and="" empty="">

Maybe you are looking for

  • It is constant flickering or flashing on the pages.

    It's so boring. The flicker of the web pages or blink especially when the cursor is went on top of the Web page where the toolbar, shortcuts and open tabs are. Sometimes it flashes even if the mouse is not used. Some suggestions that I have tried are

  • Are there drivers for the recorder sony icd-bp150 for windows 7

    Are there drivers for the recorder sony icd-bp150 for windows 7? I can't recorder to work with the current drivers of dvr3. It works on XP machines but not my computer windows 7...

  • Allowing the scanning of an iMac

    I have a HP Photosmart 6510 printer which I use printing and scanning wireless to my iMAc. It worked fine before with the iMAC and I have no trouble printing or scanning of my windows machine now.I've recently updated to Yosemite on my iMac. When I t

  • Corrupt Config\Sys

    I get an error message "missing or damaged Config\System" on startup. I don't have a disc for a restoration? The computer company has no disks by their Web site. Anyone know what I can do?

  • Computer freezes Vista, get the error of the audio control panel has stopped working

    my computer is running windows vista Home premium and after it starts and connects to the home screen, it immediately freezes and it says the audio control panel stopped working and the mouse and the keyboard does not work Reference Dell inspiron 530