How to find multiple occurences in Hashtable

I have a hashtable in which elements are stored with their values. Elements (keys) are labelled as
Dept_1_2
Dept_1_3
Dept_2_3
etc
Now if I want to access all occurrences that start with letters Dept, how can I do that?? Should I use some kind of Regular Expression for pattern matching or is there other way?
Thanks in advance

Hashtable doesn't provide any method to do this. You will have to write a function that looks through the keys (hashtable.keys()) and perform the check (key.startsWith("Dept")) for each key.

Similar Messages

  • How to replace multiple occurences of space in a string to a single space?

    How to replace multiple occurences of space in a string to a single space?

    Hi,
    try this code.
    data : string1(50) type c,
              flag(1) type c,
              dummy(50) type c,
              i type i,
              len type i.
    string1 = 'HI  READ    THIS'.
    len = strlen( string1 ).
    do len times.
    if string1+i(1) = ' '.
    flag = 'X'.
    else.
    if flag = 'X'.
    concatenate dummy string1+i(1) into dummy separated by space.
    clear flag.
    else.
    concatenate dummy string1+i(1) into dummy.
    endif.
    endif.
    i = i + 1.
    enddo.
    write : / string1.
    write : / dummy.

  • How to find multiple keys in single cell using Numbers?

    I'm trying to add functionality to one of my Numbers tables where want to check a single cell for multiple keywords from a list. The hole thing works perfectly fine in Excel but it behaves differently in Numbers.
    The formula I am using is:
    =IF(ISERROR(LOOKUP(2^15;FIND($E$2:$E$11;A2)));"not found";"found")
    The following screenshots show that it correctly finds the keys in the cell when using Excel but not in Numbers. Although, it seems to work if the key is in the same row as the input cell.
    Excel table using the formula I posted in the C column:
    Numbers table using the formula I posted in the C column:
    Would be really happy if somebody knows how I could accomplish that!
    Cheers,
    Maik

    If you are working in Numbers you can do this efficiently with a small AppleScript without going back to Excel or clone. One click and you get the following result:
    This script works with Numbers 2.3, which your screenshot suggests you are using. If you are using Numbers 3 it needs a very small adjustment.
    This is the script:
    --https://discussions.apple.com/thread/6315365?tstart=30
    property inputCol : 1 --> col A, as in example
    property resultCol : 3 --> col C, as in example
    property keysCol : 5 --> col E, as in example
    property targDoc : 1 --> 1 is front document; can change to "MyDocName"
    property targSheet : 1 --> 1 is first sheet; can change to "MySheetName"
    property targTable : 1 --> 1 is first table; can change to "MyTableName"
    tell application "Numbers"
              set t to document targDoc's sheet targSheet's table targTable
              set keysList to t's column keysCol's cells's value
              repeat with i from 2 to t's row count -- assumes 1 Header Row
                        set inputVal to t's row i's cell inputCol's value
                        if inputVal is not 0 then --skip blank cells; Numbers 2 reads blanks as 0
                                  --check if Input matches a key:
                                  if inputVal is in keysList then
                                            set t's row i's cell resultCol's value to "found"
                                  else
                                            set t's row i's cell resultCol's value to "not found"
                                  end if
                                  --check if Input contains a key:
                                  repeat with aKey in keysList
                                            if inputVal contains aKey then set t's row i's cell resultCol's value to "found"
                                  end repeat
                        end if
              end repeat
    end tell
    --end of script
    To run, copy into AppleScript Editor, change the properties if needed, and click the green triangle 'Run' botton.
    SG

  • How to find multiple entries in the Directory

    Hi,
    my directory contains lot of multiple entires and I want to find out is there a easier method by a script or command to find out all the mutiple entries in the directory.
    Thanks!!
    Message was edited by:
    Sun_One@TCS
    Message was edited by:
    Sun_One@TCS

    Are you talking about entries that have been renamed because of a Replication Naming conflict (like the entry was added on 2 masters at the same time) ?
    If so, please check the Administration Guide, Replication section.
    <http://docs.sun.com/app/docs/doc/819-0995/6n3cq3av8?a=view#gdquf>
    If you were talking about something else, please be more explicit. Directory Server does not allow you to create multiple entries with the same name. DNs are unique.
    Regards,
    Ludovic

  • How to find multiple entries in Tcode MEK1.

    Hi,
    I developed a BDC for MEK1 --> material nfo Record (Plant-Specific)
    It's working without errors. (Values entered successfully)
    Still in few cases - User find Data display problem.  (Previous data in place of new entered)
    I think - It's because of Validity - (From - To Validity)
    Now - I want to check all entered values ( For Cnd type - Vendor + Material + Plant  combination) with diff validity period.
    How can I get this.
    I tried few tables - also ST05 but unable to find the Records.

    material nfo Record (Plant-Specific)
    I want to check all entered values ( For Cnd type - Vendor + Material + Plant combination)  with diff validity period.
    Table is A017 for your keys + dates (While code - Rem. It's a pooled table )
    Amount in KONP-KBETR.

  • How to find multiple copies of pictures on the harddisk ?

    Hi Everybody,
    I have the feeling that many of my pictures have multiple copies in different locations on the harddisk which obviously occupies unneccessary space. Is there any way to easily search fro them in order to delete them e.g. similar to the function "show dublicate songs" in iTunes ?
    Thanks
    Tom

    Tom:
    iPhoto by design will have either two or three copies of the file. The original, full sized file, the thumbnail and a modified version if you've done any editing. That fact cannot be avoided. If you see duplicates while in the library then you can use Duplicate Annihilator. That should remove the types of duplicates that can be safely removed. Do not try removing any from the Finder! Don't tamper with files in the iPhoto Library folder from the Finder.

  • How to find multiple transport requests for one object

    Hi all,
    Is there any function module which will fetches multiple transport requests ( if created ) for one object.I tried almost all the function modules , but i didn't got the solution.
    I need to develop a report ,   which will takes a single Task number as input and gets the Request number from table E070.
    Based on that Request Number i will fetch remaining Task numbers under it.
    Then for all the Tasks Numbers, i am fetching their  objects by using table E071.
    I need to list out  whether any of these objects are in multiple Transport Requests. Once i got all the Transport Request numbers i need to release the Request based on their Transport Request sequence.
    I tried the following FM's , but not able to get the solution.
    SVRS_DISPLAY_VERSION_LIST
    SVRS_GET_VERSION_DIRECTORY_46
    SVRS_GATHER_REQUEST_FRAGS
    Thanks..

    Hello
    I have tried with below code
    DATA list_tab TYPE TABLE OF abaplist.
    SUBMIT RSWBO040 USING SELECTION-SET 'TEST'
                    EXPORTING LIST TO MEMORY
                   AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
       TABLES
         listobject = list_tab
       EXCEPTIONS
         not_found  = 1
         OTHERS           = 2.
    IF sy-subrc = 0.
       CALL FUNCTION 'WRITE_LIST'
         TABLES
           listobject = list_tab.
    ENDIF.
    break-point.
    Submitting the program(RSWBO040) of SE03 transaction a will result in 'CNTL_ERROR' dump.
    Please try some other options
    Thanks

  • How to find multiple transport status

    I have a list of 800 transports (Released from Dev) .Now i wanted to check the status of this transports(Upto where it is moved). Is there any option in sap to check the details in one shot..

    Hi,
    the use of this forum is frequently misunderstood:
    This is an expert forum for questions around the SAP Transportation Management (SAP TM) solution that allows to plan real world logistics like moving of pallets in containers, finding routes for trucks, scheduling rail cars or calculating freight costs for an ocean shipment. [Homepage] Questions regarding Software Logistics, Transport of customizing entries, copying of system settings between development and quality management systems should not be placed here.
    The Transports you are asking about is misplaced - though answered - here.
    Regards
    Clemens

  • How to Find Multiple Missing Folders?

    Just migrated to a new computer and moved my photos to a new folder. Now I see the missing folder question mark for each folder in Lightroom. I can control click on each folder and point to the folder, but have a few hundred folders. Is there a quicker way? All the file naming info is the same, except one of the main folders in the hierarchy has a different name.
    Lightroom 2.7
    Mac OS 10.6

    Find the topmost folder in a heirachy and then all those below should also reappear too when re-linking.
    Alternatively change the name of the folder back to what LR thinks it is and then change it again to what you want it to be in LR itself.
    Always easier to change or move folders in LR to avoid that.
    However, moving multiple folders in LR can be painful as you can only ever move one at a time, so sometimes I move things around outside of LR knowing I'll have to repair links. But if I'm doing major folder shuffling, I use a proper file browser and then relink the top folder in LR or Synchronize, whichever is easier.
    I do have a well structured file heirachy, so I don't have to rearrange things very often, but when tidying up my girlfriend's folders....!!

  • How to find multiple instances of buttons

    Hi all.
    I am currently adapting a piece of work from another of our business partners so that it is accurate for our own area of business (yes we are allowed to)
    The creator has placed a certain image button into the product that links to different external web pages.
    This all works well, however, I now need to change the links on these buttons so that the policies that appear are our own and not theirs.
    These buttons are not named in any way other than by their filename (padlock)
    Captivate lists them simply as Button_***
    Is there any way of searching for these buttons so that I don't miss any?
    There are quite a few in this 100 slide project.
    Any help is appreciated,.
    I've tried the Ctrl-F search but it doesn't allow you to narrow it down to a specific button. And I cannot find any usage statistics for buttons in the properties anywhere.
    Regards

    Hi there,
    First way to check the button is from the Timeline, everything which you're using is available in timeline. Please check the screenshot:
    And to change the links in Captivate, just select the button in your project and check the properties panel in the Right side. Check the screenshot.
    Hope this helps.
    Thanks
    Priyank

  • How to Find Multiple Email Accounts

    I'm a new iPad user so sorry if this is a silly question! I have 2 email accounts, work and home. My home account opens fine, but my work email I know is set up, but it doesn't appear in my Inbox. I hear alerts that it's receiving emails, but I can't find them. What did I do wrong?

    Hi and welcome....
    Tap Settings on your Home screen then tap *Mail, Contacts, Calendars*.
    Under Accounts at the top of the window, make sure the work mail account has been set up.
    If not, tap *Add Account*
    You can edit that account from there also.
    Carolyn

  • Finding multiple occurences of a char in a string

    So I am trying to make a check to see if there is more than one comma in an entry such as the following.
    "Johnson, Mr. Derrik J."
    I figured out that to make sure it has a comma can be...
    if (stringHolder[1].indexOf(",") > 0 == false)
    System.out.println ("");
    System.out.println ("Error G");
    So to make sure there are not more than 1 comma would be? I'm stuck.

    perhaps the simplest way
    if(stringHolder[1].indexOf(",") != stringHolder[1].lastIndexOf(","))

  • How to find the number of occurence of a string

    String str="The AR tech seeks experienced candidates in java,jsp. The candidates should have atleast 1 year of experience in the specified skills.";
    here i need to find the number of occurence of the string "experience".
    how to find it out?

    String str="The AR tech seeks experienced candidates in java,jsp. The candidates should have atleast 1 year of experience in the specified skills.";
    String findStr = "experience";
    int count = 0;
    int index = 0;
    while(index != -1) {
    index = str.indexOf(findStr, (count == 0 ? 0 : index + findStr.length()));
    if(index != -1) {
    count++;

  • How to add multiple devices to find my iPhone app

    I am trying to add several iphone devices so I can keep track of kids phone. Does anyone know how to add multiple phones?

    Welcome to the Apple Community.
    settings > iCloud > Find my Phone on each device.

  • I "downloaded" the newest iphone software (5.1.1.) instead of "download and install" cause i have multiple devices, now i have no idea how to find it?

    I "downloaded" the newest iphone software (5.1.1.) instead of "download and install" cause i have multiple devices, now i have no idea how to find it? It said that the download had completed 5 hours later and now when i plug in my iphone and click update it starts downloading it again even though i've already done that. How do i install the update i've already downloaded?

    Do you know where the downloaded file is saved ?? Use the SHIFT button while pressing the restore option in iTunes. It will allow you to browse the downloaded file.

Maybe you are looking for

  • Using mail with hotmail accounts/university accounts..

    I have a hotmail account and a university e-mail and was wondering if I would use those through mail? Because I know the only way to send things in pdf's from pages, lets say, is through mail.

  • Getting at a JAR file resource from an applet

    I have an applet, which contains a class DBFReader (which I did not write, and do not have source code to). DBFReader takes a string as an argument that indicates the file name/location: DBFReader mine = new DBFReader(String filelocation); The file I

  • Adaptive Webservice model for asynchronous web services

    Hi , While tring to use adaptive Webservice model, using WSDL provided by XI, i was geting the error, <i>Cannot load NameSpaces and ModelClasses</i> . Details of the error can be found in Error while creating Adaptive WS model(SP17) using local WSDL

  • Event Handling for NotePad clone

    Hi, I was wondering if anyone knows where I can find a good resource for the event handling of a notepad clone. I really am having trouble with finding something that can help me. I'm not really sure where to start. Thanks.

  • Video.app black screen

    64 GIG 3G ======== Watching a video on the train and the 3G cellular connection is lost (through the tunnels). A message appears with "Dismiss" or "Settings" which interrupts the video so hit "Settings" to turn airplane mode on so avoid the constant