REGEX - find zip code in text

Hi experts!
I have to find the zip code (for germany) in a given text. I found 5 digits in my text, but my problem is to ignore numbers which consists of more than 5 digits!
My first try works for all cases but not for the last one.
FIND FIRST OCCURRENCE OF REGEX '([0-9]{5})' IN ld_string SUBMATCHES ld_plz.
D-12345 Mainz -> should match 12345
D 12345 Mainz -> should match 12345
12345 Mainz -> should match 12345
12345Mainz -> should match 12345
Mainz D-12345  -> should match 12345
D-123 45 Mainz -> error because of the space between the numbers
D-12333345 Mainz -> error because only 5 digits are valid for a germany zip code; my REGEX does not work!
Thanks a lot!
Regards,
Florian

Hi Florian,
curiosity persists.
After some playing around I reduced the pattern using Placeholder for any single digit \d. Then I noticed that the 5-digit-sequence will also match 5 digits out of 6, so i used \D Placeholder for any character other than a digit Then I don't know how to recognize (optional) line start or end as alternative to non-digit, so I just enclose the string to be checked into spaces - please suggest a more elegant solution.
My test form
FORM regex .
  DATA:
    lv_subm   type string,
    lt_string TYPE TABLE OF string.
  FIELD-SYMBOLS:
    <string>  TYPE string.
  APPEND:
    'D-12345 Mainz' TO lt_string,
    'D 12345 Mainz' TO lt_string,
    '12345 Mainz'   TO lt_string,
    '12345Mainz'    TO lt_string,
    '123456Mainz'    TO lt_string,
    '123 45Mainz'    TO lt_string,
    'Mainz D-12345' TO lt_string.
  LOOP AT lt_string ASSIGNING <string>.
    clear:
      lv_subm.
    CONCATENATE ` ` <string> ` ` into <string>.
    FIND REGEX '\D(\d{5})\D' IN <string> SUBMATCHES lv_subm.
    WRITE: / <string>, 20 'matches', 30 lv_subm,40 'SY-SUBRC=', sy-subrc.
  ENDLOOP.
ENDFORM.                    " REGEX
creates this output:
D-12345 Mainz     matches   12345     SY-SUBRC=     0
D 12345 Mainz     matches   12345     SY-SUBRC=     0
12345 Mainz       matches   12345     SY-SUBRC=     0
12345Mainz        matches   12345     SY-SUBRC=     0
123456Mainz       matches             SY-SUBRC=     4
123 45Mainz       matches             SY-SUBRC=     4
Mainz D-12345     matches   12345     SY-SUBRC=     0
As I do not fully understand the meaning of FIRST OCCURRENCE, I just removed it.
Regards,
Clemens

Similar Messages

  • Need an Exit  to find ZIP code of Delivery address in PO.

    Hi Experts,
    I am an abaper & i am tryin to connect Taxwar & SAP during the prcess of PO creation.
    Now my req is to find if the plant address & the Delivery address are different ( need to compare the ZIP codes).
    Can anyone sugget an exit where i can do thi comparison?
    regards,
    Kevin.

    Hi kevin,
    Use the below given code, after executing this it will ask the transaction code of which u are requiring exit, give the tcode over there u can get exits available for that tcode.
    ABLES : tstc, "SAP Transaction Codes
             tadir, "Directory of Repository Objects
           modsapt, "SAP Enhancements - Short Texts
            modact, "Modifications
             trdir, "System table TRDIR
             tfdir, "Function Module
           enlfdir, "Additional Attributes for Function Modules
            tstct, "Transaction Code Texts
           RSSTCD,
            TRKEY.
    *& Definition of Types                                                  *
    TYPES: BEGIN OF t_badi_list,
                    obj_name TYPE sobj_name ,
                    devclass TYPE devi_class ,
                     dlvunit TYPE dlvunit,
                    imp_name TYPE exit_imp ,
                    packname TYPE devclass ,
                    dlvunit2 TYPE dlvunit,
                        text TYPE sxc_attrt-text,
          END OF t_badi_list.
    TYPES: BEGIN OF t_badi_list2,
                    obj_name TYPE sobj_name ,
                    devclass TYPE devi_class ,
                     dlvunit TYPE dlvunit,
           END OF t_badi_list2.
    *& Data Declaration                                                     *
    DATA: lt_badi_list TYPE TABLE OF t_badi_list,
         lt_badi_list2 TYPE TABLE OF t_badi_list2,
          ls_badi_list TYPE t_badi_list OCCURS 0 WITH HEADER LINE,
         ls_badi_list2 TYPE t_badi_list2.
    RANGES: r_badi FOR tadir-obj_name ,
           rt_badi FOR tadir-obj_name .
    *& Variables                                                            *
    DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE,
        P_TRKEY LIKE TRKEY.
    DATA : field1(30),
           BADINAME(20),
           COUNT TYPE P.
    DATA : v_devclass LIKE tadir-devclass,
          p_devclass LIKE tadir-devclass,
          p_old_langu LIKE sy-langu,
          p_mod_langu LIKE sy-langu.
    *& Selection Screen Parameters                                          *
    SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
    PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK a01.
    *& Start of report                                                      *
    START-OF-SELECTION.
    Validate Transaction Code
    SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
    *Find Repository Objects for transaction code
    IF sy-subrc EQ 0.
      SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR'
                                  AND object = 'PROG'
                                AND obj_name = tstc-pgmna.
      MOVE: tadir-devclass TO v_devclass.
      IF sy-subrc NE 0.
    This section is used if a FGR is involved\!
        CALL FUNCTION 'RS_ACCESS_PERMISSION'
             EXPORTING
                   global_lock = 'X'
                        object = p_tcode
                  object_class = 'TRAN'
                          mode = 'SHOW'
             language_upd_exit = 'RS_TRANSACTION_LANGUAGE_EXIT'
       suppress_language_check = space
            IMPORTING
           new_master_language = p_old_langu
         modification_language = p_mod_langu
                 transport_key = p_trkey
                      devclass = p_devclass
           EXCEPTIONS
              canceled_in_corr = 1
                        OTHERS = 2.
        IF SY-SUBRC = 0. " Success
          MOVE: p_devclass TO v_devclass.
        ELSE. " For the case that nothing is found\!
          SELECT SINGLE * FROM trdir WHERE name = tstc-pgmna.
          IF trdir-subc EQ 'F'.
            SELECT SINGLE * FROM tfdir WHERE pname = tstc-pgmna.
            SELECT SINGLE * FROM enlfdir WHERE funcname = tfdir-funcname.
            SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR'
                                        AND object = 'FUGR'
                                      AND obj_name = p_devclass.
            MOVE: tadir-devclass TO v_devclass.
          ENDIF.
        ENDIF.
      ENDIF.
    *Find SAP Modifactions
        SELECT * FROM tadir INTO TABLE jtab
                            WHERE pgmid = 'R3TR'
                             AND object = 'SMOD'
                           AND devclass = v_devclass.
        SELECT SINGLE * FROM tstct WHERE sprsl EQ sy-langu
                                     AND tcode EQ p_tcode.
        FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
        WRITE:/(19) 'Transaction Code - ', 20(20) p_tcode, 45(50) tstct-ttext.
        FORMAT COLOR COL_POSITIVE INTENSIFIED ON.
        SKIP.
        WRITE:/1 'The application area is:', v_devclass.
        SKIP.
        IF NOT jtab[] IS INITIAL.
          WRITE:/(95) sy-uline.
          FORMAT COLOR COL_HEADING INTENSIFIED ON.
          WRITE:/1 sy-vline, 2 'Exit Name', 21 sy-vline, 22 'Description', 95 sy-vline.
          WRITE:/(95) sy-uline.
          LOOP AT jtab.
            SELECT SINGLE * FROM modsapt
                           WHERE sprsl = sy-langu
                              AND name = jtab-obj_name.
            FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
            WRITE:/1 sy-vline, 2 jtab-obj_name HOTSPOT ON, 21 sy-vline , 22 modsapt-modtext,
            95 sy-vline.
          ENDLOOP.
          WRITE:/(95) sy-uline.
          DESCRIBE TABLE jtab.
          SKIP.
          FORMAT COLOR COL_TOTAL INTENSIFIED ON.
          WRITE:/ 'No of Exits:' , sy-tfill.
          SKIP.
          WRITE:/(83) sy-uline.
          FORMAT COLOR COL_HEADING INTENSIFIED ON.
          WRITE:/1 sy-vline, 2 'Badi Name', 22 sy-vline, 23 'Description', 83 sy-vline.
          WRITE:/(83) sy-uline.
    select the BAdI Definitions from the tables sxc_exit and sxc_attr
          SELECT tobj_name tdevclass tcdlvunit sximp_name sat~text
                       INTO CORRESPONDING FIELDS OF TABLE lt_badi_list
                       FROM ( ( ( ( tadir AS t
                       INNER JOIN
                         tdevc AS tc ON tdevclass = tcdevclass )
                       INNER JOIN
                         sxc_exit AS sx ON sxexit_name = tobj_name )
                       INNER JOIN
                         sxc_attr AS sa ON sximp_name = saimp_name )
                       INNER JOIN
                         sxc_attrt AS sat ON sximp_name = satimp_name )
                       WHERE t~pgmid = 'R3TR'
                       AND t~object = 'SXSD' "means BAdI
                       AND t~devclass = v_devclass "narrow down seach with Dev.Class
                       AND sat~sprsl = sy-langu.
          SORT lt_badi_list.
          DELETE ADJACENT DUPLICATES FROM lt_badi_list.
    create Ranges
          LOOP AT lt_badi_list INTO ls_badi_list .
            r_badi-sign = 'I' .
            r_badi-option ='EQ' .
            r_badi-low = ls_badi_list-imp_name .
            r_badi-high = ls_badi_list-imp_name .
            APPEND r_badi TO rt_badi .
          ENDLOOP.
    select the implementations
          SELECT tobj_name tdevclass tc~dlvunit
                INTO CORRESPONDING FIELDS OF TABLE lt_badi_list2
                FROM tadir AS t
                INNER JOIN
                  tdevc AS tc ON tdevclass = tcdevclass
                FOR ALL ENTRIES IN rt_badi
                WHERE t~obj_name = rt_badi-low
                AND t~pgmid = 'R3TR'
                AND t~object = 'SXCI'.
          FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
          WRITE:/(83) sy-uline.
          COUNT = '0'.
          LOOP AT lt_badi_list INTO ls_badi_list .
            WRITE:/1 sy-vline, 2 ls_badi_list-obj_name HOTSPOT ON, 22 sy-vline,
                  23 ls_badi_list-text, 83 sy-vline.
            COUNT = COUNT + 1.
          ENDLOOP.
          WRITE:/(83) sy-uline.
          DESCRIBE TABLE ls_badi_list.
          SKIP.
          FORMAT COLOR COL_TOTAL INTENSIFIED ON.
          WRITE:/ 'No of BADIs:' , COUNT.
        ELSE.
          FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
          WRITE:/(95) 'No User Exit exists'.
        ENDIF.
      ELSE.
        FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
        WRITE:/(95) 'Transaction Code Does Not Exist'.
      ENDIF.
    *& Call SMOD or SE18 to lead the user to the selected exit or badi      *
    AT LINE-SELECTION.
    GET CURSOR FIELD field1.
    IF field1(4) EQ 'JTAB'.
      SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
      CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    ELSEIF field1(12) EQ 'LS_BADI_LIST'.
      CALL FUNCTION 'SXO_BADI_SHOW'
           EXPORTING
             EXIT_NAME = sy-lisel+1(20)
           EXCEPTIONS
             ACTION_CANCELED
             ACCESS_FAILURE
             BADI_NOT_EXIXTING.
    ELSE.
    ENDIF.
    Regards
    Arani Bhaskar

  • Please help, finding all zip codes within a given radius.

    I have a table which contains zip, city, state, latdec, longdec, latrad, longrad.
    From search screen, user want's to find all zip code's, within
    10 mile radius of his zip code.
    I came up with following sql but it is not correct:
    First, find his latdec, longdec from his zipcode.
    Then add radius to those values and do select as follows:
    select zip,
    latdec, longdec,
    city, state, latrad, longrad
    from zip_coord
    where latdec >= (latdec - 10)
    and latdec <= (latdec + 10)
    and longdec >= (longdec - 10)and longdec <= (longdec + 10).
    I think i need to include radians too, but i'm not able to come up with logical formula.
    I would appreciate any help with this topic.
    Thanks in advance

    I am not sure I understand the gerography concept, but I think the query should be like this:
    select zip, latdec, longdec,city, state, latrad, longrad
    from zip_coord
    where latdec between( select latdec from zip_record where zip='userinput', select latdec+10 from zip_record where zip='userinput')
    and longdec between( select longdec from zip_record where zip='userinput', select longdec+10 from zip_record where zip='userinput')
    and latrad between( select latrad from zip_record where zip='userinput', select latrad+10 from zip_record where zip='userinput')
    and longrad between( select longrad from zip_record where zip='userinput', select longrad+10 from zip_record where zip='userinput')
    Hope, it can help.
    Aiping

  • Sql help please with, finding all zip codes within a given radius.

    I have a table which contains zip, city, state, latdec, longdec, latrad, longrad.
    From search screen, if user want, zip code's within 10 mile radius of his zip code, what is the sql. I came up with following sql but it is not correct:
    first, find his latdec long dec from his zipcode. Then add radius to those values and do select as follows:
    select zip,
    latdec, longdec,
    city, state, latrad, longrad
    from zip_coord
    where latdec >= (latdec - 10)
    and latdec <= (latdec + 10)
    and longdec >= (longdec - 10)and longdec <= (longdec + 10).
    I think i need to include radians too, but i'm not able to come up with logical formula.
    I would appreciate any help with this topic.
    Thanks in advance

    gautam ,
    u probably need to use oracle spatial option and store geoCodes for each address as a column in the address table . then doing this will be easy

  • Where do I find the code on my Mac to allow iPhone text messages to also be sent and received on iMac?

    where I can find the code that is supposed to be shown on my Mac to allow iphone text messages to also be sent and received on iMac?

    Hi,
    Long Answer.
    Enable the iPhone for Messages.  Make sure it Verifies and that your can Send from the iPhone Number.
    To do that you can Enable the iMessages account in Messages on the Mac using and Apple ID.
    The iPhone can then send from the iPhone Number to the Apple ID (Mac).
    Then add the Apple ID to the iPhone.
    The Mac will then get a pop up saying that the iPhone is using the Apple ID and the iPhone number.
    Accept this Pop up to enable the Mac to "sync" the iPhone Number iMessages.
    (Sync in this case is only "Display on All Devices").
    Now you can enable Text Forwarding on the iPhone.
    IF the Apple ID and iPhone Number are already linked this will launch the app if it is Quit and display the Code number you need.
    The number then need to be entered back on the iPhone to complete the process.
    The Text Forwarding option on the iPhone should then show the device(s)  that are linked this way.
    9:12 pm      Wednesday; March 11, 2015
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • Safari 2.0 zip code bug?

    This is a problem I've started to notice on a bunch of webpages (including newegg.com) with Safari 2.0. Many times Safari will not let me enter my zip code into an HTML form field because it starts with a zero (like about half the zip codes in the U.S. northeast). Let us say my zip code is 02142 -- when I enter it in, Safair "autocorrects" it to "2142" after the control loses focus. Nothing seems to undo this, and I can't find any setting that fixes it. So the site I submit it to says, "Hey, that's not a valid zip code!" I've tried it with Firefox and Internet Explorer and neither seem to do this behavior (so I often have to leave whatever transaction I was trying to go through, open up Internet Explorer, and re-do the entire transaction -- all because Safari doesn't trust me to know what I want to type in).
    The HTML code from newegg.com which is doing this: <input name="zipcode1" type="text" size="4" maxlength="5" value=""> So it's nothing in particular about the form coding that I can tell -- it looks like Safari is just assuming that because I'm typing in a number, I can't possibly want it to start with a zero. Which is just ridiculous in a large number of contexts.
    Any way to turn this off? It is really getting irritating, and it's the sort of "application knowing what I want to do better than I do" idiocy which I think of being exclusively in the domain of Microsoft products. Which ironically don't seem to have this problem!
    NOTE: I am not using an Autofill zip code. I am just trying to enter it in manually.

    I can confirm this bug (isn't it irritating?). One solution is to use another browser; I've never had this problem in Firefox. Another would be to turn off AutoFill; even though you're not using an AutoFill entry, AutoFill seems to have this unfortunate effect on leading zeros entered manually.
    Next time you run across a page that won't take your zip code, click on Safari/Report bugs to Apple and send a bug report. Maybe if enough of us on the East Coast complain, someone will fix it.

  • Finding A Piece Of Text Within A Text?

    Hi.
    I am trying to create a program to find a piece of text within a file (containing text). I know that my life could be made much easier if I had the util.java.regex package but it doesn't seem to import.
    I am working on a Windows XP Platform.
    I have tried the Hello World program which works fine but it is just trying to import this package...

    I am trying to work through this slowly so that I can understand each stage... so where I have come upto now is why does the following code not compile. I am just interested in taking a .txt file at the standard input which is used to serach against an Actor's name that I specify in the next (argument?) line?
    Thanks for all the help
    My Code so far...
    import java.io.*;
    // This line always has to be put in
    public class MyFirstFileReadingAppTwo
              // Main method
              public static void main (String args[])
              // Stream to read file
              System.out.print("Enter your filename: ");     
              BufferedReader br = new BufferedReader(new FileInputStream (System.in));
              String userName = null;
              try
              // Open the input stream
              String file = br.readLine();
              BufferedReader reader2 = new BufferedReader(new FileReader(file));
              // Read a line of text
                   System.out.println(new
                   ln(new (fin).readLine() );
              // Close our input stream
              fin.close();          
                   // Catches any error conditions
                   catch (IOException e)
                   System.err.println ("Unable to read from file");
                   System.exit(-1);
    }

  • Import a Zip Code Field Into Numbers

    I'm sure this has been asked before, but I've done a couple of searches and can't find the answer.
    I often need to import a list of addresses into a spreadsheet for cleaning up. In Excel, when I do this, I "open" a text file and get the "import wizard." I can then format the zip code field as a text field and retain any leading zeros (e.g., 00678 is not converted to the number 678).
    How can I do this in Numbers?
    Message was edited by: Joel Mcintosh1

    Blazeland wrote:
    What if the data is of varying lengths? I data with 10, 12 or 13 digit numbers that sometimes have leading zeros. I can't open csv files into Numbers because it deletes the zeros and there is not standard length to the data.
    It's certainly not the reason explaining that you can't open the Numbers generated csv files.
    Numbers put a delimiter between values so their length is meaningless.
    The problem may be the value of the delimiter.
    As I wrote MANY times, if the decimal separator used by the running operating system is period, Numbers use comma as values delimiter.
    If the decimal separator is comma, Numbers use the semi-colon as values separator.
    Yvan KOENIG (from FRANCE mardi 24 mars 2009 21:13:18)

  • Leading Zeros in Zip Code

    I frequently export address information from a database to a tab-delimited text file and then import it into Numbers. However, some zip codes have leading zeros (i.e., "00644"). When I import this file into Numbers the zip codes with leading zeros lose their zeros (i.e., the field looks like ... "644").
    If I format the field after the import as "Text," it doesn't resolve the problem.
    How do I retain these zeros?

    briegull wrote:
    Yvan only discusses Apple products but I look for the best, cheapest solution I can find. In this case it's the free NeoOffice (I would guess Open Office would be the same).
    I do what we are supposed to do on this forum.
    excerprt from Terms of Use:
    +*What is Apple Discussions and how can it help me?*+
    +Apple Discussions is a user-to-user support forum where experts and other Apple product users get together to discuss Apple products.+
    Why being able to format zip codes (when probably a quarter of the US population has a zip code that starts with a leading zero)
    As 0 is one digit among ten, my guess is that the real percentage is about 10%
    is considered beyond the "eighty percent" rule that Yvan cites often, I don't understand, but the solutions he proposes aren't very realistic for spreadsheets created frequently.
    The given soluce may be "not realistic" but it is used since 1990 by AppleWorks's users.
    But a Numbers's user may refuse to apply the given workarounds and wait for enhancements.
    For some of them he will have to wait until iWork'09, for others for iWork'10 …
    I think that helpers are here to give workarounds for today, not to give false hopes.
    Here is an excerpt of Apple Human Interface Guidelines
    +Apply the 80 Percent Solution+
    +During the design process, if you discover problems with your product design, you might consider applying the 80 percent solution‚ that is, designing your software to meet the needs of at least 80 percent of your users. This type of design typically favors simpler, more elegant approaches to problems.+
    +If you try to design for the 20 percent of your target audience who are power users, your design may not be usable by the other 80 percent of users. Even though that smaller group of power users is likely to have good ideas for features, the majority of your user base may not think in the same way. Involving a broad range of users in your design process can help you find the 80 percent solution.+
    Yvan KOENIG (from FRANCE mardi 19 février 2008 14:54:36)

  • Leading zeros for zip codes in Numbers

    I couldn't find an answer for this question but finally figured it out so wanted to share. Here's how I got the zeros to show in my zip code column:
    You can make a custom cell format from the cells palette. You have to hide the separator and add a digit using the Integers bubble. Then choose show zeros for unused digits.
    Then apply this format to the entire zip code column in your doc.

    I was having the same problem. You pointed me in the right direction but in 09 the prompts are slightly different.. Hilight the column. In the cell inspector, cell format, choose NUMERICAL SYSTEM and set the number of places to five.
    It should now look right but before you save it, create a new column and format it as above into TEXT. Then copy the one you've fixed, and paste it into the new text column. This should save fine as cvs in any event, as well as numbers.

  • Help me find out who is texting me from a hiden number

    I was texted today something very stalkerish which seems to be someone that we know hiding behind a texting app or possibly a different number (since you can alter your zip codes making it hard for someone to find out where the message is coming from). The text was asking for permission to take my daughter out on a date and was using specific information about us, our family and including specific names and locations which is scaring us. The zip code is not anywhere near our area. I was wondering if there was any possible way we could find out who this is or if you could verify with me that this number if being used by your service. The number is: ****
    Any information would be helpful and appreciated. Thank you.
    [Edited to comply with Guidelines]

    Please report this to the police. It would require a court order to get the owner of the phone number.

  • Expression - Zip Code validation

    We have the field called Zip Code and this is a text field and 10 Chrs long.
    Field 1:  State
    Field u2018Stateu2019 is a lookup field and  the lookup table has Country, state code and state name.
    Field 2:  Zip Code
    Zip Code = text field and the length is 10 chrs.
    The ZIP Code Validation should be either NNNNN format (Block of 5 digits) for standard ZIP Code OR
    NNNNN-NNNN format (Block of 5 and 4  digits) for ZIP+4 format
    For example, if the country = US and state = IL then the first digit of the postal code field will be 6 then remaining 4 digits must be numeric for the standard 5 digit Zip code.
    Can anybody help me to write the expression. Full points will be rewarded.

    Hi,
    Try this it should work,
    For example, if the country = US and state = IL then the first digit of the postal code field will be 6 then remaining 4 digits must be numeric for the standard 5 digit Zip code.
    I am assuming here State = IL indicates state code = IL which is field in your Lookup table. As you said your Lookup table having fields Country, state code and state name
    IF(FIND(State.Country, "US") AND FIND(State.state code, "IL"), LEFT(Zip Code,1)=6 AND HAS_ALL_CHARS(RIGHT(Zip Code,4),0,9), FALSE)
    otherwise if your State having IL value is simple text field in maintable then replace it as
    IF(FIND(State.Country, "US") AND FIND(State, "IL"), LEFT(Zip Code,1)=6 AND HAS_ALL_CHARS(RIGHT(Zip Code,4),0,9), FALSE)
    Hope it will Help you,
    Rewards if Useful......
    Mandeep Saini

  • When I do a mail merge using an excel document it transfers correctly except the Zip Code part

    I have a Word Document that I use to send out advertising letters in the mail. I get the information from an excel spreadsheet that i put together and it usually works out fine but recently after i have done the mail merge the Zip Code is not coming out.
    It only shows as a zero "0". 
    I have maybe around 200 letters that i send out every week and after like the 1st 10 pages the merge doesn't work on the Zip Code.
    Could you please let me know what I can do to fix it?
    Both the Word and Excel Versions are 2007
    Thanks!
    Cynthia.

    One thing I have done before when getting similar issues is changing the "ZipCode" field to a text field instead of a
    number field. This is done in the field properties.
    Don't forget to mark the post that solved your issue as &quot;Answered.&quot; By marking the Answer you are enabling users with similar issues to find what helped you. Lewis Renwick - IT Professional

  • Find words within a text file

    Hey all.
    I am playing around with the idea of finding a line of text within a text file, by using scanner and some next methods.
    The way I am trying to get it to work is that one enters a string and the program then finds all the lines of text containing that
    user-entered string and then prints them.
    The text file in question contains names of University papers and their room numbers, quantity of students etc.
    Example:
    IBUS212     EALT006     1am     72     AL     LI     
    BMSC241     MCLT102     2     pm     8     AL     COOREY     
    My problem annoyingly enough seems to be that I can't think how one could compare the string entered to the lines of text being
    scanned in the text file.
    My latest go involved what you see in the code, scanning the examdata.txt file for a user-entered course number, using course.next();
    by going with the example above it would be IBUS212. The task was to then to find all of the lines containing that number and print them out using
    println (what I have tried with id and line) as well as the rest of that line eg: EALT006     1am     72     AL     LI .
       public void printCourse()
        try
            String details, input, id, line;
            int count;
            Scanner user = new Scanner(System.in);
            System.out.println();
            System.out.println();
            System.out.println("Please enter your course ID: ");
            input = user.nextLine();
            Scanner course = new Scanner(new File("examdata.txt"));
            course.next();
            course.nextLine();
            id = course.next();
            line = course.nextLine();
            if(input.equals(id))
                System.out.println("Your course times are: "  + id + "and" + line);
            else
              System.out.println("Your course does not exist."); 
            catch(IOException e)
                System.out.print("File failure");
      }Any advice/help/troubleshooting would be greatly appreciated.
    Edited by: AUAN on Aug 13, 2009 9:43 AM
    Edited by: AUAN on Aug 13, 2009 9:44 AM
    Edited by: AUAN on Aug 13, 2009 9:49 AM

    You'll want [to loop while|http://java.sun.com/docs/books/tutorial/java/nutsandbolts/while.html] the course Scanner has a next line and then print the line if it contains the entered text.
    For useful methods you can check the Javadoc of String and Scanner (use your browser search on keywords like 'next' or 'contains' to find them).

  • Is there a way of adding a zip code locator

    I'm doing a website for a business with 6 locations and would like for the customer to be able to type in their zip code to find the closest store in their area.
    I've done a custom google map usng (mapsenginelite) but would like to add some how the zip code locator. Any help would be much appreciated.
    Here's the site I've been working on http://www.cortezautopros.com/locations.html
    Thanks Ben

    This free extension may help http://www.dmxzone.com/go/21863/html5-data-bindings

Maybe you are looking for

  • Export database in quiet mode

    I'm trying to export database (or part of it) via exp utility. Exp utility should be called from command file or from another process (on windows). If something goes wrong (for example user name or password is not correct) exp pauses it's execution a

  • Am I the only one with this problem? And is there a fix for this? What causes it to happen? More details in the description. Thanks!

    Hi, I have an iPhone 5s, sometimes when I'm using an app(game) I am unable to quit the app. The funny thing is: the app is still working fine, doesn't hang and I can still interact with it, but I just can't quit it or access multitasking( be it using

  • Okay need some help badly

    Okay i have been having problems all day today. first mobile me now everything apple. For some reason i can't get safari to connect to the internet, firefox works fine, itunes store will not come up, mail doesn't connect, and when i go to mobile me i

  • Zen Micro Photo shuts off by its

    My player shuts off randomly and when I turn it back on it has to rebuild the library. I I loaded the new firmware and did a system clean up and it still happens. Just wonderring if anyone else had has this problem with their player.

  • Could someone explain this to me, please?

    I fixed a problem without really understanding how and why the problem occured or even why my fix worked.  I'm hoping somebody can explain it to me.  Here's the problem: My form had this structure: MainSubform      Page1Subform           Subform1