GREP code for find/change

Hi everyone,
I have a list of about 500 entries, with each entry being formatted as follows:
Firstname [tab] Lastname [tab] State [tab] Level
I need to perform a find/change operation using some 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 last name and the state and replace it with a comma and a space. Then finally I need to target the tab between the state and level and also replace it with a comma and space.
I wondered if someone could tell me what the code would be for this type of operation?
Appreciate any assistance.

You can also do it in a single search:
Find
(.+?)\t(.+?)\t(.+?)\t
Replace
$1 $2, $3,
(there's a space after the $3,)

Similar Messages

  • GREP query for find/change operation

    Hi everyone,
    In the following line, there's a comma after the first name. This type of formatting is repeated hundreds of times on a number of pages so I need to use a GREP find/change query to remove the comma after the first name and replace it with a space.
    Firstname,Lastname,State
    I wondered if something could tell me what the GREP code would be?
    Appreciate any assistance.

    function(){return A.apply(null,[this].concat($A(arguments)))}
    ..  it's also doing it for the second comma
    That's impossible. You must have entered something else than Scott's code.

  • GREP code for changing $150.00 to $150.  ?

    I am trying to save space in a multi-column catalog.  Many prices are whole dollar amounts.  What would be the GREP code for finding and replacing?

    Eugene,
    Your GREP seems to work but it's over-enthusiastic: it finds any two-digit number preceded by a dot, so also "23.00%" and "4.20 am". The reason is that you thought that [\$\d+] would match "a string consisting of $ and/or digits", but you'd need [\$\d]+ for that. But that doesn't work in the GREP expression (?<=[\$\d]+\.)\d\d because the possible matches in a lookbehind must be the same length. Your [\$\d+] is a strange beast which, though it's wrong, made it seem as if the expression worked. Strange coincidence!
    Since matches in lookbehinds must be the same length you cannot use *, +, and ? in them. Instead, you need to enumerate the patterns, something like this:
       (?<=\$\d\.) |
       (?<=\$\d\d\.) |
       (?<=\$\d\d\d\.)
    00
    (Without the spacing and the returns, naturally.)

  • Need a code for finding prime no.s from 0 to 100.

    Hi,
    i need a code for finding prime no.s from 0 to 100.
    Please help me out.
    Regards,
    Santosh Kotra.

    hai santosh,
    here is an example program to find the prime number...........
    EXAMPLE:
    DATA: BEGIN OF primes OCCURS 0,
            number TYPE i,
            exp    TYPE i,
          END OF primes.
    DATA: w_mult TYPE i,
          w_limi TYPE i,
          w_prem TYPE i.
    DATA: w_outp TYPE text132.
    DATA: w_rtime TYPE i,
          w_stime TYPE p DECIMALS 3.
    DEFINE add_part.
      sy-fdpos = strlen( &1 ) + 1.
      &1+sy-fdpos(*) = &2.
      condense &1.
    END-OF-DEFINITION.
    PARAMETERS: p_numb TYPE i,                "number to check
                p_fact TYPE c AS CHECKBOX,    "display components
                p_nbpr TYPE c AS CHECKBOX.    "nb of primes
    START-OF-SELECTION.
      GET RUN TIME FIELD w_rtime.
      IF p_nbpr IS INITIAL OR p_numb LE 12000.
        PERFORM eratostene USING p_numb.
        add_part w_outp p_numb.
        READ TABLE primes WITH KEY number = p_numb.
        IF sy-subrc = 0.
          add_part w_outp 'is prime'.
        ELSE.
          IF p_fact IS INITIAL.
            add_part w_outp 'is not prime'.
          ELSE.
            add_part w_outp '='.
            w_limi = p_numb.
            LOOP AT primes WHERE exp GT 0.
              CHECK primes-number LE w_limi.
              IF w_prem GT 0.
                add_part w_outp '*'.
              ENDIF.
              IF primes-exp GT 1.
                add_part w_outp '('.
                add_part w_outp primes-number.
                add_part w_outp '^'.
                add_part w_outp primes-exp.
                add_part w_outp ')'.
              ELSE.
                add_part w_outp primes-number.
              ENDIF.
              w_limi = w_limi / ( primes-number ** primes-exp ).
              IF w_limi = 1.
                EXIT.
              ENDIF.
              w_prem = 1.
            ENDLOOP.
          ENDIF.
        ENDIF.
        WRITE: / w_outp.
        IF NOT p_nbpr IS INITIAL.
          DESCRIBE TABLE primes LINES sy-tmaxl.
          CLEAR: w_outp.
          add_part w_outp 'Number of primes:'.
          add_part w_outp sy-tmaxl.
          WRITE: / w_outp.
          SKIP.
          LOOP AT primes.
            WRITE: / primes-number.
          ENDLOOP.
        ENDIF.
      ELSE.
        PERFORM factors.
      ENDIF.
      GET RUN TIME FIELD w_rtime.
      w_stime = w_rtime / 1000000.
      SKIP.
      CLEAR: w_outp.
      add_part w_outp 'Calculation time:'.
      add_part w_outp w_stime.
      WRITE: / w_outp.
          FORM eratostene                                               *
    FORM eratostene USING in_number TYPE i.
      DATA: BEGIN OF no_primes OCCURS 0,
              number TYPE i,
            END OF no_primes.
      DATA: cnum TYPE i,
            dnum TYPE i,
            limi TYPE i,
            mult TYPE i,
            puis TYPE i,
            cmod TYPE i.
      IF NOT ( p_fact IS INITIAL AND p_nbpr IS INITIAL ).
        limi = in_number.
      ELSE.
        limi = sqrt( in_number ).
      ENDIF.
      cnum = 2.
      WHILE cnum LE limi.
        READ TABLE no_primes WITH KEY number = cnum.
        IF sy-subrc NE 0.
          primes-number = cnum.
          mult = 2.
          puis = 1.
          dnum = mult * cnum.
          WHILE dnum LE in_number.
            READ TABLE no_primes WITH KEY number = dnum.
            IF sy-subrc NE 0.
              no_primes-number = dnum.
              APPEND no_primes.
            ENDIF.
            IF NOT p_fact IS INITIAL.
              cmod = dnum MOD ( cnum ** puis ).
              IF cmod = 0.
                cmod = in_number MOD ( cnum ** puis ).
                IF cmod = 0.
                  primes-exp = puis.
                  puis = puis + 1.
                ENDIF.
              ENDIF.
            ENDIF.
            mult = mult + 1.
            dnum = mult * cnum.
          ENDWHILE.
          APPEND primes.
          CLEAR: primes.
        ENDIF.
        cnum = cnum + 1.
      ENDWHILE.
    ENDFORM.
          FORM factors                                                  *
    FORM factors.
      DATA: ex_factors TYPE string,
            mod        TYPE i,
            still      TYPE f,
            factor     TYPE i,
            exponent   TYPE i,
            square     TYPE f,
            fac_string TYPE text40,
            exp_string TYPE text40.
      IF p_numb LE 3.
        ex_factors = p_numb.
      ELSE.
        factor = 2.
        still  = p_numb.
        DO.
          CLEAR: exponent.
          mod = still MOD factor.
          WHILE mod = 0.
            exponent = exponent + 1.
            still    = still div factor.
            mod      = still MOD factor.
          ENDWHILE.
          IF exponent EQ 1.
            fac_string = factor.
            CONCATENATE ex_factors '*'  fac_string
                                   INTO ex_factors
                           SEPARATED BY space.
            CONDENSE ex_factors.
          ELSEIF exponent GT 1.
            fac_string = factor.
            exp_string = exponent.
            CONCATENATE ex_factors '* (' fac_string
                                   '^'   exp_string ')'
                                   INTO  ex_factors
                           SEPARATED BY space.
            CONDENSE ex_factors.
          ENDIF.
          factor = factor + 1.
          square = factor ** 2.
          IF square GT still.
            EXIT.
          ENDIF.
        ENDDO.
        IF still GT 1.
          CATCH SYSTEM-EXCEPTIONS convt_overflow = 1.
            fac_string = factor = still.
          ENDCATCH.
          IF sy-subrc NE 0.
            fac_string = still.
          ENDIF.
          CONCATENATE ex_factors '*' fac_string
                                INTO ex_factors
                        SEPARATED BY space.
          CONDENSE ex_factors.
        ENDIF.
        SHIFT ex_factors UP TO '*'.
        SHIFT ex_factors BY 2 PLACES.
      ENDIF.
      WRITE: / p_numb RIGHT-JUSTIFIED.
      IF ex_factors CA '*^'.
        WRITE: '=', ex_factors.
      ELSE.
        WRITE: 'is prime'.
      ENDIF.
    ENDFORM.
    HOPE THIS WILL BE HELPFULL.
    regards
    praba.

  • Code for finding CPU utilisation for executing query

    Hi, i need code for finding CPU utilisation for executing the particular query.

    Use session tracing, then in trace file you can find cpu utilization for particular statement on each phase: parse, execute, fetch and the overall.
    Or You can use the dbms_utility.get_cpu_time (if your database is 10g) in pl/sql:
    declare
    cpt1 pls_integer;
    cpt2 pls_integer;
    cputime pls_integer;
    begin
    cpt1:=sys.dbms_utility.get_cpu_time;
    <some code here>
    cpt2:=sys.dbms_utility.get_cpu_time;
    cputime:=cpt2-cpt1;
    end;
    good luck

  • Relation ship code for finding manager position..

    Hi Experts,
    How to find the relationship code for finding Manager position of France and US.
    i know that
    A012 is the relationship code for France,
    What should be the relationship code for US?
    Thanks in advance.

    Hi
    If you take tables QMEL & DRAW / DRAW & QMFE
    if u have created a document in CV01N, with the object link has notification... Then you will be able to able both these tables...
    Document will be displayed...
    Both has same relationships.... you have to maintain the notification in document management system.
    Check out the linking details in SPRO - Cross-Application Components - Document Management - Control Data - Define Document types
    - Pithan

  • Help for find/change glyphs script

    Hi everyone!
    I need help for creating a script (or modifying existing script) that should replace every Cyrillic character  from an old ASCII font with the same Cyrillic character but from new Unicode font.
    For example: Capital letter 'A' GID=107 from old font (Lazurski) should be replaced with 'A' GID=630 from new one (Myriad Pro).
    I can do this by using Indesign Find/Change - Glyphs, but this will take me too much time.
    So, I need a scrip for this job.
    My first attempt was to use the FindChangeByList script by modifying the FindChangelist.txt document, but without success.
    Here is what I've used until now:
    1)  glyph {glyphID:107, appliedFont:"Lazurski"} {glyphID:630, appliedFont:"Myriad Pro"} {caseSensitive:false, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
    2)  glyph {findWhat:"u00C0", appliedFont:"Lazurski", fontStyle:"Bold"} {changeTo:"0410", appliedFont:"Myriad Pro", fontStyle:"Bold"} {caseSensitive:false, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find ASCII A replace with Unicode A.
    Both lines didn't change anything. What is wrong?
    Any help is welcome!
    Regards,
    Veselin
    P.S. Indesign CS5

    Thank you Jongware!
    The codes (both ID and Unicode) are correct for sure, but even with correct notation (obviously my was wrong) the script don't change anything.
    Here is the line in the FindChangeList:
    text {findWhat:"\u00C0", appliedFont:"Lazurski", fontStyle:"Bold"} {changeTo:"\u0410", appliedFont:"Myriad Pro", fontStyle:"Bold"} {caseSensitive:false, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find ASCII A replace with Unicode A.
    Update:
    Finally, I found what is wrong with the script - the properties "caseSensitive:false".
    By removing that properties the script works fine.
    So, I successfully converted a book with old ASCII Cyrillic font to Unicode Opentype font.

  • Complete List of Error Codes for Customized Change Password Page

    Hi,
    does anyone has a complete list of "Change Password Page Error Codes"?
    The list provided in the document:
    Oracle® Application Server Single Sign-On Administrator's Guide
    10g (9.0.4)
    Part Number B10851-01
    seems to be incomplete. (See: http://download-uk.oracle.com/docs/cd/B10464_01/manage.904/b10851/custom.htm#1009955 )
    I found at least three additional / different error codes:
    auth_fail_err
    pwd_minlength_err
    pwd_numeric_err
    I'm using a JSP Page.
    Thanks for help

    Hi,
    I found the list in the OID Admin Documentation. The list contains the error messages the OID sends to the client. In case of SSO, the client for the OID is the SSO server. So now I know which errors are transmitted to the server, I have to find out what the server sends to the SSO Page for Password change. Probably I should test all cases documented in the OID Admin doc to find the appropriate values for SSO Server.
    Thanks for the tip

  • JS for Find/Change

    I am a novice with JS, but trying to make a couple of enhancements to workflow using scripting. I have managed to figure most things out ok, but usually just need a little kickstart. What I am trying to do is:
    InDesign CS2
    Find a specific sequence of characters in a text selection (in this case, " - " (that is space dash space) and replace with end of nested style & forced line break (^h^n). At the same time, search for double carriage returns and change to single carriage returns (^p^p => ^p).
    Currently, using the Find/Change Function from the Edit menu but I'd like to be able to just apply a script to do it all. I have tried to dig through the archives for a similar posting, but haven't had a lot of luck. If anyone can please point me in the right direction, it would most certainly be greatly appreciated!
    Thank you in advance.
    -Scott

    Thank you Peter ... I have just purchased the electronic version of the O'Reilly book that you recommend. This will certainly help.
    One thing that is not clear ... can I use characters such as "^p" or "^h" directly when setting my parameters, or is there a unicode equivalent that I would need to use?
    Thanks again.
    -Scott

  • TIP: Clean slate for find/change

    Hi,
    Sharing a little tip I just thought of. Very straightforward and
    obvious, but quite useful, and I haven't noticed it mentioned elsewhere.
    If you're doing a lot of find/replace, you'll repeatedly need to remove
    all selections and start with a clean slate (nothing in the find/replace
    fields, clear all formatting).
    It seemed to me for a while that we're missing a "Clear All" button in
    the find/replace box.
    So the answer is simple: clear everything, all options, etc., and save
    it as a find/replace query.
    Now whenever you need a clean slate for find/save, just select that query.
    It's working nicely for me!
    Happy new year,
    Ariel

    I was going to stay out of this, but find I can't. Sometimes it seems to me that scripters see everything as being better solved through scripting.
    I actually think Ariel's observation about saving a blank query is quite brilliant, and I have to agree that there are times, and plenty of users like me who don't use a KB hortcut to access find change, where users will find having the saved blank query much faster than any other method of clearing the dialog. Both methods have their place, but I find it disingenuous to say that Jongware's scriptlet "solves" the case where you want to keep the old values -- it actually complicates things as you then must remember if you are to run the KB shortcut, or use the menu, to acieve the desired result.
    I think it would be far better to say that this, like many things in ID, can be accomplished in more than one way, and that they way you do it may be different at different times, and that the mehod of choice is exactly that, a choice subject to the user's own preference.

  • T-Code to find changes

    Can any one please tell me:-
    1- The T-Code to find out the changes made in standard SAP programs by consultants who were on this project before so that i get the exact count of how many programs have been changed?   
    2-How do i find out the number of logical databases created?
    3-How do i find out the number of use exits and customer exits implemented?
    4-Number of programs in which BDC is involved?
    Thanks in advance

    1- The T-Code to find out the changes made in standard SAP programs by consultants who were on this project before so that i get the exact count of how many programs have been changed?
    You can use the version management concept.
    try menu path <b>GOTO >  VERSION > VERSION MANAGEMENT.</b>
    This will show the versions / changes made to a program from time to time.
    Reward Points if useful.

  • Code for finding the factorial of a no

    program  for finding the factorial of a no........

    hi
    the following are the 2 different codes  for factorial
    PARAMETERS:
      P_NUMBR TYPE I.
    DATA:
      W_FACT TYPE I VALUE 1,
      W_TEMP TYPE I.
    W_TEMP = P_NUMBR.
    DO P_NUMBR TIMES.
      W_FACT = W_FACT * W_TEMP.
      SUBTRACT 1 FROM W_TEMP.
    ENDDO.
    WRITE: W_FACT.
    USING MACROS
    DEFINE FACTORIAL.                      " Define macro
      DO 5 TIMES.                          " Do 5 times
        IF &1 GT 5.
          EXIT.
        ELSE.
          &2 = &1 * &2.
          WRITE: /'The factorial of &1 is'(001),&2.
        ENDIF.                             " Endif
        &1 = &1 + 1.
      ENDDO.                             " Enddo
    END-OF-DEFINITION.
    DATA:
        w_fact TYPE I VALUE 1,             " Factorial
        w_temp TYPE I VALUE 1.             " Temp
    FACTORIAL w_temp w_fact.
    regards,
    kiran kumar k

  • Help regarding code for title change

    Hi All,
    I have a requirement like whenever we change the PO ie., when we change the  line item data say for example, if there is a quantity like 20kg and if we want to update itto 30kg., the PO will be changed.
    In such change cases, the title of the PO should be changed to "Purchase Order Change". 
    In these cases, the changes will be recorded in the table CDHDR and CDPOS.
    Can anyone pl tell me of how to write the code for this in the script as well as in the subroutine ...
    Help will be rewarded the best..

    Done. Found out the solution

  • Best practice to verify 'public' code for unauthorized changes

    Hi everybody,
    I have to make sure, that some "critical" classes within my project are only executed during runtime, when they are authorized by me. On the other hand these classes are not secret and the source is available for others.
    I thought about signing the jar and verifing the jar during runtime but this check could be already altered.
    What do you think is the best solution for my problem ? The "verifing code" can be obfuscated if needed.

    Hi,
    Per my understanding, you might want to find a better way to create Lookup field.
    Though there are different ways to create Lookup field(declaratively or programmatically), there would be no much difference between them in performance or maintenance.
    If going in the declarative way, the whole definition of the field will be hardcoded, user simply need to deploy the solution, Lookup field to a specific list will be there.
    If creating the field programmatically, there would be great flexibility when provisioning a field as we will be able to specify the properties dynamically.
    Thus, you might need to make a choice depends on the scenario in the actual production environment.
    Thanks
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Code for find the missing number in array without sorting/comparing in java

    Hi all,
    We have 1 to 100 number in an array, but one number is missing (from 1 to 100). we have to find it out without sorting or comparing of this missing number in array.
    please help me out to find the solution this query.
    regards & thanks
    Mohan Kumar
    Bangalore,
    India

    Maybe you could sum up the numbers you've got in your array and subtract the result from 5050 [the term [code](N*N+N)/2 where N is your upper bound (i.e. 100)]. You'll get the sum of all missing values (which in this case would be exactly the missing number). n.b. that you could genaeralize on that for arbitrary finite series.
    Kind Regards,

Maybe you are looking for

  • JDeveloper 10g Creating a new record with trigger sequence primary key

    Hi there, I'm sorry to post this incredibly simple question and I'm sure that someone must have answered this on this forum before but the searching of this site is incredible slow and painful and after 30 mins I can't find help. I am using a struts

  • Error 1402: Could not open key ..... IMAIL

    I am trying to install Adobe Reader 9 on a friend's computer.  He desperately needs it to print pdf documents. I have tried everything I know, including removing all traces of Adobe from the registry and from the files.  I don't seem to be able to re

  • Sent email not being saved :-?

    I have often issues with using mail and google imap, but it's not usually mission critical stuff. But I have one issue which is really really annoying me, sending a reply to one particular email: when I send, it's not saving my message anywhere, eith

  • ITunes installation on a PC

    I tried to reinstall iTunes on my PC and get an error message that I'm missing a file MSVCR80.dll

  • Hi Friends: Do we have ESS and MSS in ABAP web dynpros

    Hi Forum, Do we have SAP std. web dynpros on ESS and MSS , do you list out this ABAP web dyn on this.. Thanks in Advance, Srinivas M.