GREP code for find/replace

Hello world

I have a list of about 500 entries, with each entry formatted as follows:

First name [tab] [tab] [tab] State level

I need to do a find/replace using GREP code that will target the tab between the first and last name and replace it with a space. Then I need to target the tab between the name and the State and replace it with a comma and a space. Then finally, I need to focus on the tab between the State and the level and also replace it with a comma and a space.

I was wondering if someone could tell me what would be the code for this type of operation?

Appreciate any assistance.

To find

^([^\t])+\t

Replace

$1 [space]

To find

\t

Replace

[space]

Tags: InDesign

Similar Questions

  • Y at - it a keyboard shortcut for find/replace?

    Hello and thank you in advance,

    Using the functionality of InDesign CS - 5 find/replace, I am always using the search/replace button.

    Is there a way to create a keyboard shortcut for this option, replace/find? ***

    Since I use it so often, it would be good that it could be one of the 'F' keys: F1, F2 or something else.

    I looked in 'Edit-> keyboard shortcuts'... but I couldn't find the option replace/find here.  Have I missed?

    Thanks again,

    Zorba

    It's here: System, section keyboard preferences. Check the box to enable access direct function key, or uncheck it and hold down the "Fn" key then press F4.

    (Note how it is easy to use the forum software to insert images with.) No need to link to the image riddled advertising cabins!)

  • object contains no text for find/replace

    I am trying to run this script to select text if it is found, but he said that there is no text, even though I have wrapped them in an if statement.

    See section function () {}

    app.findGrepPreferences = app.changeGrepPreferences = null;

    app.findGrepPreferences.findWhat = "the (section\\s +?). \\d+ ? [ \\.\\d+]?)";

    app.changeGrepPreferences.changeTo = "$1";

    The app.changeGrepPreferences reference .appliedCharacterStyle = "cross";

    If (app.activeDocument.findText ()) {}

    found. Select();

    };

    var changes1 = app.activeDocument.changeGrep ();

    If {(changes1.length===1)}

    Alert (changes1.length + "instance of 'the section' became 'article'.");

    } else {}

    Alert (changes1.length + "instances of 'the section' changed to 'section'.");

    }

    };

    Your message to find/replace script highlight found text is not the same question?

  • Need help with this find/replace Script.

    Hi I got this script from Loic.Aigon.  And I got it works for find/replace simple changes however I Cannon operate for several changes.

     function cb5CallBack(target) {
            var findProps, changeProps;
            
                findProps = {findWhat:"Distributed by ",}   
                  changeProps = { changeTo:"Distributed by. ",}
                findProps = {findWhat:"Distribué par ",}   
                  changeProps = { changeTo:"Distribué par. ",}
                findProps = {findWhat:"Distribuido por ",}    
                  changeProps = { changeTo:"Distribuido por. ",},
              
            RTXT(target, findProps, changeProps);   
            } 
    

    function RTXT(target, findProps, changeProps)
    {
    app.findChangeTextOptions.caseSensitive = true;
    app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences.properties = findProps;
    app.changeTextPreferences.properties = changeProps;
    app.changeTextPreferences.properties = changeProps;
    target.changeText();
    }
    

    You must call the function RTXT repeatedly as well:

        var findProps, changeProps;

        findProps   = { findWhat:"Distributed by "};

        changeProps = { changeTo:"Distributed by. "};

        RTXT(target, findProps, changeProps);

        findProps   = { findWhat:"Distribué par "};

        changeProps = { changeTo:"Distribué par. "};

        RTXT(target, findProps, changeProps);

        findProps   = { findWhat:"Distribuido por "};

        changeProps = { changeTo:"Distribuido por. "};

        RTXT(target, findProps, changeProps);

  • InDesign CC Grep find/replace to replace the character of space per paragraph (fly)

    Hello InDesigners,

    I'm trying to clean up a 99 page document. In the file, titles of chapters, in capital letters, followed by a space, which is then followed with text more uppercase there. This always occurs at the beginning of a paragraph.

    I'm trying to target the space character that appears just after the number of chapter and Exchange to a number (fly).

    For example:


    CHAPTER 22 SUNDAY UNDERGROUND

    I want the Grep to change this as follows:

    CHAPTER 22

    SUNDAY UNDERGROUND

    I know that to do this job, I need to use positive look behind and positive Look Ahead, at first, I just tried to isolate CHAPTER 22 using the following:

    ^ \u{2,}\s\d+

    It worked. However, as soon as I cut and paste into P.L.B., find/replace says that it does not match.

    (?<=^\u{2,}\s\d+)\s


    The culprit seems to be the comma that comes just after the number 2. If I take, I get a match, but just not the one I wanted.


    Why P.L.B. does not accept the comma as part of the range in my definition grep?


    (FYI, I prefer to use wildcards with a specified scope, rather than literal text).

    It is indeed the comma, and the reason why it does not work because the flavor of InDesign's GREP does not allow a variable length argument in its lookbehinds. And the construction "has {x, y}" indicates a variable length.

    "Chapter" only you know how many characters to uppercase, and even the exact text, you can use

    (?<=^CHAPTER>

    the first chapters to a number, then

    (?<=^CHAPTER>

    for the rest. In your version of InDesign, I guess there is also a possible solution with the fairly new \K "forget - me" operator but I have not yet enough experience with that. It should look like this:

    ^ \u{2,}\s\d+\K\s

    but you will have to experiment a bit to see how to work with the replacement string.

    In addition, you should only use the name of "fly" for a character that looks like this: "¶". The code that you insert will call it a 'return' or 'paragraph return. Initially, I took your question literally, and it sounded as if you were after this result: "CHAPTER 22 ¶ SUNDAY UNDERGROUND"

  • 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)

  • Jump to replace jump of blackBerry that I can't buy an unlock code for?

    I have a new Bond that is a telus replacement for a failed unit form, it came without a box and the Appointment #, I tried two different unlock suppliers and can't find a code for me, they tried my service provider and claim to have tried bb, is this common will, it will be a code published in the future for my phone? Thanks in advance for any help

    on a side note, the two unlock companies tried them for a few days before giving me a refund.

    Problem solved, what I had to do was get a person who uses a Telus phone when trying to network to get the unlocked jump, when the first attempt failed blackberry Telus contacted and sent me a code from them, this code has worked, it has more money to a third party, but only by a little money

  • GREP find/replace + paragraph Styles

    Hello

    I'm editing a long document and have benefited from the assistance of the community already, but being new GREP Style, find/replace, I need to ask for additional help.

    Below a screenshot of the script (original). Two blocks of text you see anticipated by the icons have have styles of different paragraphs. Icons are placed like custom glyphs.

    Now, the last line with C2, 9, 14,... is the target of this post. They are buses of London and I created a paragraph with another icon. The copy that I work with unfortunately is as you see. Buses will follow «;»

    Resulting to place a \r after the semicolon and assign the new paragraph style. The item to work with is (probably) the last "," before the registration of the bus. All entries have it in the same way, where a search/replace global grep should work fine.

    My attempts:

    I used of a previous debate (? < =------;)) [^ ;] + $ to match everything from the end until the last semicolon, but then I found the problem preserving the matched characters and placing \r (using the (? < =-;). start at the beginning and stops at each point comma + space)

    So question: how to stop at the first semicolon at the end and replace the space with \r to create a new paragraph?

    Then, it is two question :-)

    From my previous attempts, I noticed that when you replace the semicolon + space with \r, and change the style of paragraph at a time (from Rail to Bus) caused the Rail paragraph style change (logic) to the style of Bus. So I tried to say the paragraph style of the track "Following paragraph Style is style of Bus" (and not to change the paragraph style in find/replace), but in a way that no longer works.

    Second question is: given to split the find/replace in two steps, how then transform / apply to newly created paragraph the correct style of Bus?

    Thank you in advance for your valuable assistance. So far, the community has been great!

    Antonio

    Original

    Screen Shot 2016-07-12 at 22.32.23.png

    Result for

    Screen Shot 2016-07-12 at 22.54.51.png

    Hi Antonio,.

    If I understand correctly, in 2 regex [1 click play with Multi/find-replace our friend Martinho da Gloria]:

  • Find/replace style cell with GREP

    Hi all, (my first post here)

    I found a script very useful on this forum to find/replace cell styles in an array. I adapted the script using Peter Kahrel ebook for use with a GREP query.

    I've linked to a spreadsheet in InDesign CC 2014 I want to highlight the cell of new products that contain the value [Y].

    When I run the script below, I get random results.

    myDoc = app.activeDocument var

    app.findGrepPreferences = app.changeGrepPreferences = null

    app.findGrepPreferences.findWhat = "\[\u\"]

    var myFound = myDoc.findGrep)

    for (i = 0; i < myFound.length; i ++)

    {

    If (. parent.constructor.name myFound [i] == "Cell")

    {

    . parent.appliedCellStyle myFound [i] = "New_Product_Cell".

    }

    }

    Modify the script that I wrote above.

    Otherwise your discovery is just '[u]' ==> multi-ad found is--> Direct manufacturer name


    Jarek

  • Find/replace for text formatting

    Hi guys,.

    How to use find/replace for text formatting changes? I would like to change a text of entire book to try an another typographical options. The book is currently typed in text of Lyon. The problem is when I change to Sabon will make it overides the italics and the word "BOLD".

    I tried to find/display

    Search

    Lyon text regular italic

    Change

    Sabon italic

    Captura de pantalla 2015-02-18 a la(s) 10.17.19.png

    but it does not work. Most of the text of this book is not formatted with the character to italic Style, for example, just a paragraph Style General to make it easier to work with.

    What I am doing wrong? Any help or ideas?


    Thank you!

    All of the text has a paragraph style that applies the formatting of basis for the whole paragraph. ALL text that deviates from the General formatting of the paragraph should have a style of character applied somehow, either directly, or as a nested or style GREP, which overrides the formatting of paragraph and gives what you want. The paragraph styles that do not change the font family are much more useful, for example a style that just changing the text in italics, as they continue to work when you change the font family of the paragraph style in the basic text format section.

    Character styles are used ONLY to change the part of the text in a paragraph. If the paragraph has the same formatting, it should have a paragraph set for this format style.

  • looking for a replacement code instead stage.invalidate

    Hello. I have a project

    I have an image that hold a flvplayback

    also I need an mp3 player, so I want to when I get the flv frame break and after the audio synopsis image output mp3 sound, the video also stop (cause otherwise the sound of the flv has played in another frameworks)

    I use this script:

    stage.invalidate();
    
    mene.addEventListener(Event.RENDER,exitingF);
    mene.addEventListener(Event.REMOVED_FROM_STAGE, removedF);
    
    function exitingF(e:Event):void{
    
                controller.gotoAndStop(2);
                pausePosition = sndChannel.position; 
                sndChannel.stop();
                isPlaying = false;
    }
    
    
    function removedF(e:Event):void{
                mene.stop();
                controller.gotoAndStop(1);
                sndChannel = soundClip.play(pausePosition);
                isPlaying = true;
    }
    

    Shiner is the name of the instance of FLvplayback, all function work very well

    the problem comes when I want to convert and create exe Flash projector with other third-party tools like ZInc, Swfkit

    After I compile my swf to exe and running prjector, when I click on the menu that load frame contain flvplayback, watch the video, the healthy break and everything is ok

    but when I want to go to another frame, and then click the other menus, my projector having replied to the questionnaire and no closed shot!


    I check, step by step and remove this framework code to find what cause this code and I found, its: stage.invalidate ();

    I don't know why but it seems its none compatible or confilict with these thirdparty app

    can someone help me find a replacement for stage.invalidate (); and help me run my projector?

    Thank you

    I've been wrong onstage.invalidate();

    I have thoghth it used for removedF function, but it seems he used to Event.RENDER

    so I just remove all script associated with exitingF and add:

                controller.gotoAndStop(2);
                pausePosition = sndChannel.position;
                sndChannel.stop();
                isPlaying = false;

    for the goto frame playback flv button.

    solved my problem and I think I don't need to use Stage.invalidate (); Event.Render or more

    lucky, Dear Kglad give me a real simple way to run the script on a specific image here: http://forums.adobe.com/message/5148931#5148931 , so I need never really stage.invalidate.

    Thank you sinious for advise and answer too

  • Find/replace highlights the bad code

    Hi, if you use find it normal and the search for specific text in my AS3 class file, it highlights the right position where he finds corresponding text, but when I use the search/replace completely it messes up, it highlights the text wrong in my code, but it displays the correct position in the Find/Replace window. Is there a way to fix this, or is this a known bug? See attached screenshot.

    Screen Shot 2013-06-19 at 10.56.15 PM.png

    Hello

    Thanks for sharing the file.

    The problem is with the end of Line (EOL) character. The file uses a rating of CR at the end of his LIFE and has been used in Mac OS 9 and Mac OS 9 version. When a file is created using one of these versions of Mac OS and then the EOL character would be CR which is now obsolete and is not recognized by many modern text editors.

    If the EOL is LF or CR | LF then search and replace will work as expected in Flash CC.

    You can change the end of LIFE of the file to open and save the file in Wordpad that will change the EOL to CR | LF.

    Hope this information helps you solve your problem.

    Thank you!

    Mohan

  • Find + replace text (string constant) does not work for screw Statechart module

    Hello

    I tried to do a mass find + replace a string in my code. Using Ctrl + F, LabVIEW 2012 correctly locates all the places where this string exists, including within the States transitions guards who have paths in this form:

    XYZ.lvsciagram.vi / Transition: Guard - diagram, Transition, data/part

    However, when I've specified that a replacement string, then click on 'Replace all', only 'normal' instances of screws replaced - instances in my diagrams had not changed.

    What is going on? Is there anything else I need to do?

    Thanks in advance.

    Looks like those that does not include how to find and replace is implemented in LabVIEW. You can try to replace just the statechart and see if that makes a difference, but it may simply not work.

  • reinstalled Vista needs, but I can't find the code for button... what to do now?

    bought a laptop without windows on it to buy a vista disk ran the 30 day trial to see if I liked it, missed test, but have more business with key code...

    Hello

    http://support.Microsoft.com/kb/811224

    How to get a replacement product key

    If the software is preinstalled on your computer, contact your computer manufacturer to obtain a replacement product key.

    To replace a Microsoft product ke for a product you have purchased separately from your computer, you must contact Customer Support and Microsoft. To locate the phone number, visit the following Microsoft Web site:

    Contact Microsoft

    (http://support.microsoft.com/default.aspx?scid=fh; EN-US; CNTACTMS)

    Note When you contact the Customer Service of Microsoft and supported for a replacement product key, you may have to pay a fee. You may also provide information on your computer or from the product CD or DVD when you talk to the customer service representative.

    See you soon.

  • How can I find the URL codes for images stored in the Windows Photo Gallery?

    How can I find the URL codes for images stored in the Windows Photo Gallery?

    If you want the path to the current record
    right click to the picture location of a photo...
    and choose... Properties / General tab.
    Location displays the path.

    If you have a photo saved on your hard drive
    car that was downloaded on the net...
    the original URL will appear not in
    the file.

Maybe you are looking for