WildCard Characters

Hello,
I have a list of file names in a String array. Now I want to extract all the files using a wild card character.
For example if i say p* then all the files starting with the character should be brought and so on.
Thanks.
Reg,
suri

Hello,
I have a list of file names in a String array. Now
w I want to extract all the files using a wild card
character.
For example if i say p* then all the files starting
with the character should be brought and so on.
Thanks.
Reg,
suriUse regular expressions(regex'es,regexp's). There are available some 3-d party high quality free regex libraries. Ask google for 'java regex'.
Regards

Similar Messages

  • Help using -replace with wildcard characters, specifically braces

    Hello all,
    Needing help in using -replace with literal wildcard characters, specifically the braces characters. From reading old posts online this seems to have been a notorious shortcoming of PowerShell, but not sure if it's been resolved or not. My simple
    code tries to remove the braces as follows (would like to keep the foreach loop and everything as is if possible):
    $string = "test[]"
    $braces = @("``[","``]")
    Foreach($brace in $braces){
    If($string -like "*$brace*"){
    $string = $string -replace ($brace,"")
    write-host $string
    This code gives an error at the -replace line, saying "The regular expression pattern `] is not valid." I'm not sure how to pass the literal brace characters to the -replace parameter? Can this be done?

    -like is a wildcard operator (it recognized wildcard patterns like * ,? and [a-z].
    For a regular expression you use the -match operator.  
    Wildcard patterns and regular expressions are not interchangeable.
    See:
    get-help about_wildcards
    get-help about_regular_expressions
    for an explanation and examples of each one, and 
    get-help about_comparison_operators
    for examples of using -like and -match.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Features (pe03) Can wildcard characters be used in Value of Decision Field

    Hi
    When modifying a Feature using transaction PE03. Is it possible to use a wildcard character (ie.. *, ? or +) when defining the "Value of Decision Fields"?
    For example in feature CSTV1
    My tree looks as follows:
    CSTV1 Cost Grouping
    > BAREA Benefit Area
    > CA Canada
    > WERKS Personnel Area
    > CAA*
    > ON
    > CAB*
    > PQ
    > otherwise
    My Personnel Areas are CAA1, CAA2, CAA3, CAA4....etc. Rather than hardcode them I'd like to use a wild card for the last character. In my testing I can't seem to get it to work.
    Any ideas or suggestions?
    Thanks
    Edited by: bluezerby on Jul 31, 2009 6:50 PM

    Dear Blue,
    this is not possible .. as u knw... even in SAP Programs also we cannot use Wild Cards/sysmboles in Identifying Codes...
    Anywhere, u cn use wild cards to search text but not CODE
    Regards
    ...Sadhu

  • Runtime Exec on Solaris and wildcards characters

    Hello,
    I'm trying use exec in the following manner on Solaris 2.8 JDK1.3.1
    e.g. exec( "ls /tmp/*.sh" );
    When the string contains any sort of punctuation or wildcarding the command doesn't execute, usually fails with RC=2.
    exec( "ls /tmp/??.sh" ); fails
    exec( "ls /tmp/go.sh" ); works
    Any ideas or suggestions?
    thanks.

    If you haven't found the answer yet, I found it in another article. Basically, * and other wildcards are expanded by the shell so Runtime.getRuntime()exec("ls /tmp/*") won't work. You need to use the String[ ] form of exec(), i.e. Runtime.getRuntime()exec( new String[ ] {"sh", "-c", "ls /tmp/*"} )
    hope that helps.

  • Calling XML file from Flash -- Usage of wildcard characters

    Hi
    We have a Flash file, tabs.swf, (standard tab interactivity) from which we are calling the XML file using the following code:
    myXML.load("tabs.xml")
    We are using this SWF file in many learning modules created using Captivate, FrameMaker, RoboHelp, etc. by just changing the content in the XML file appropriately. The tool creates a different folder for each module.
    Now, the challenge we are having is, there will be cases where we have to use the interactivity in multiple times in the same module. In that case, content developers can change the SWF file name on their own. But they can't change the XML name without going back to media designer.
    Is there a way we can use the same SWF file to call different XML files without manually changing the XML file name every time? We have a standard naming convention for the XML files -- Tab1_<ModuleName>, Tab2_<ModuleName>, etc.
    Any help is appreciated. Thanks.
    Sreekanth

    you can edit the swf's name, and use this._url and the flash string methods to do that.

  • Using Wildcard characters in tables in S_TABU_DIS

    Hi,
       I wanted to know if there is any way to assign authorization groups in se54 to a wide range of tables with similar namespace?
    Example:
    SAP is generating tables in one transaction which all starts with /BIC/APR000 - /BIC/APR999
    The three numbers at the end are random, so the generic format for the tables are /BIC/APRnnn or /BIC/APR*.
    I want to restrict users for these tables in SM30.
    Any suggestions?
    Thanks

    When assigning authorizations you can assign (for each authorization field) a (list of)
      - single values,
      - a value interval, or
      - a prefixed value (with tailing *), or
      - any combination of them
    When using a value interval kindly make sure that the interval boundaries are of the same type; do not mix boundaries of different types. Here some examples:
    good:    0-9,  A-Z
    bad:      0-Z, §-&
    You have already mentioned an example for a prefixed value: /BIC/APR*
    In contrast to the value interval (/BIC/APR000 - /BIC/APR999) that one would also match /BIC/APRABC or /BIC/APR012345.
    So, actually the value interval (/BIC/APR000 - /BIC/APR999) is the best choice
    Regards, Wolfgang

  • Export with wildcard characters and dependant objects

    I need to take export backup for transaction tables starts with 'T%' associated with one of the tablespace test. There are other tables like start with 'H%' associated for the same tablespaces.
    exp jtest/jtest file='/u01/app/oracle/oradata/test.dmp' log='/u01/app/oracle/oradata/test.log' consistent=y tables=t%
    I can take simply export backup using 'T%' but I wanted to take export backup for all other assocated objects like index,view,triggers,functions etc. at the same time.
    I can go for user-wise export but I wanted to take backup for 'T%' tables and other objects as mentioned in the dump file.
    Can you suggest me the best way to perform this job?

    Hi,
    You have to build parameter file using SQL like this, on your required tables.
    SET HEADING OFF
    SET FEEDBACK OFF
    SET PAGESIZE 0
    SPOOL &1\list.txt
    PROMPT TABLES=(
    SELECT TABLE_NAME||','
    FROM USER_TABLES
    WHERE TABLE_name NOT IN (..., ..., ...)
    ORDER BY TABLE_NAME
    PROMPT )
    SPOOL OFF
    I call this script with sqlplus, it create a file
    list.txt that I use in the export:
    exp user/pass@sid file=list.txt <more parameters...>
    Dilipkumar Patel.

  • Find and Replace using Wildcards

    I am following the procedure outlined in Trent’s Blog:
    http://www.trentmueller.com/blog/search-and-replace-wildcard-characters-in-dreamweaver.htm l
    This is fantastic stuff and will really help me.
    I have a few (but only a few) times had success.
    It says to “Use regular expression.”  What does that mean?  What is an “irregular expression?”  I have tried with the box checked and unchecked.  Usually with the box checked it will not Find my string.  I uncheck the box and it sometimes does.
    Example:
    Link to    www.schembs.com/TEST_jds_1.html
    At the moment all the Cases are identical.  I have not uploaded the .css to the site so the right-most formating is not properly displaying.  It does work when the .css is available.
    In the source code I literally copy the line of code:
    <p class="type_X"><u>Joh. Heinrich Sch&ouml;m (1713-1785) <span  class="right-most">1.</span></u></p>
    and paste it into the Find box of F&R.  I then put my cursor above the line and it does not Find it, giving me the “Done.  Not found in current document.” response.  I uncheck the “Use regular expression” box and it will find it.
    THEN,
    I try using a wildcard (with the box checked), Finding:
    <p class="type_X">([^<]*)< p>
    or
    <p class="type_X">[^”]*< p>
    and it will find the misc. lines, e.g. where the text is “Case #1”, but not the lines of interest, with Heinrich’s name.  With the box unchecked it Finds nothing.
    Really would appreciate help.  Thanks.
    jds

    jds zigzag wrote:
    It says to “Use regular expression.”  What does that mean?
    A regular expression is a pattern for matching text. It uses a combination of literal characters and special symbols or sequences of characters (technically called metacharacters or metasequences) to represent such things as the beginning and end of a line or any alphanumeric character. For example, \d represents any number (single digit), \d* represents zero or more numbers in sequence.
    I have written a tutorial series on using regular expressions in Dreamweaver here: http://www.adobe.com/devnet/dreamweaver/articles/regular_expressions_pt1.html.
    I try using a wildcard (with the box checked), Finding: 
    <p class="type_X">([^<]*)< p>
    or
    <p class="type_X">[^”]*< p>
    They're not wildcards, but regular expressions. The first part matches the literal characters <p class="type_X">. The next sections use metacharacters.
    ([^<]*) matches zero or more characters (and as many as possible) that don't include an opening angle bracket (<). The parentheses "capture" the value that's matched so it can be used in a replace sequence.
    [^"]* matches zero or more characters (and as many as possible) that don't include a double quote. There are no parentheses, so the value is not captured for reuse.
    The closing <p> matches those literal characters.
    Regular expressions are not easy, but they're extremely powerful, and a good skill to acquire.

  • File System Task - using a wildcard in variable

    Hi,When using the "delete file" operation in the file system task I get an error stating that I have an incorrect path when using the wildcard symbol.  Is there a way around this or do I have to spell out the whole name for each file in the
    directiory.  I cannot not use the "delete directory contents" operation because I have two sub directiories in my directory.  I'm trying to use the following when I get the error
    \\devbox\df\*.csv  when I spell out whole name of the file it works.  Any suggestions?
    LISA86

    this cant be done like this. Only possible if you put file system task in for each loop container and perform deletion one at at time.
    http://technet.microsoft.com/en-us/library/ms140185.aspx
    The File System task operates on a single file or directory. Therefore, this task does not support the use of wildcard characters to perform the same operation on multiple files. To have the File System task repeat an operation on multiple files or directories,
    put the File System task in a Foreach Loop container, as described in the following steps:
    Configure the Foreach Loop container   On the Collection page of the Foreach Loop Editor, set the enumerator to
    Foreach File Enumerator and enter the wildcard expression as the enumerator configuration for
    Files. On the Variable Mappings page of the Foreach Loop Editor, map a variable that you want to use to pass the file names one at a time to the File System task.
    Add and configure a File System task   Add a File System task to the Foreach Loop container. On the
    General page of the File System Task Editor, set the SourceVariable or
    DestinationVariable property to the variable that you defined in the Foreach Loop container.
    Thanks, hsbal

  • Using wildcards in CCM 2.0 search

    Hi experts
    we're using SRM 5.0 (SRM 5.5 Server) with CCM 2.0.
    Is it possible to use wildcards in catalog search?
    Are there any documents about wildcards in CCM ?
    Regards.
    Sven

    Hi
    Yes TREX is mandatory for CCM2.0 (written in the master guide). Please restart the TREX server and retry, if this does not in your case.
    I guess, There are two wildcard characters:
    ? stands for a single character
    stands for a sequence of any combination characters of any length.
    Related links ->
    CCM 2.0 Simple search on CSE does not show any result
    Re: Cross catalog search doesn't work for CCM 2.0
    Re: Search function for Catalogue CCM 1.0 SRM version 4
    CCM view rules - based on wild cards?
    Re: Is TREX required for CCM 2.0 search?
    Hope this answers your queries. Do let me know.
    Regards
    - Atul

  • FTP - FCC - GUILDFTPd - Unable to pick up multiple files with Wildcard char

    Hi All, 
    I am not sure if my issue is strange or i may be missing something here. I am using FTP - FCC and using GUILDFTPd to connect to my local machine. This is working perfect if i don't use wildcard characters in file name but if i use them it is not picking up files. I have green in Channel monitoring and polling as mentioned for every 60 Seconds.
    I have tried both using/without using 'Advanced selection for source file'  and also checked 'Adapter specific message attributes'. The same is working if i specify exact file name. By the way, i have tried using '*' and '?' as wildcard character.
    Any idea or help in this regard is appreciated.

    I have tried with just basic. I mean, it works fine if i specify exact file name. The problem is only when i want to pick up multiple files using any wildcard character. No error in communication channel or in archive settings as the scenario working for one file without any wildcard.
    However, i have changed to NFS and it is working good even with wildcard characters.
    It seems there is a problem with GUILDFTPd which is not picking up files but no errror.
    Any ideas are welcome. Thank you both for the responses.

  • SSIS and Secured FTP Commands to GET a Remote File using wildcards

    So my biggest caveat here is dealing with wildcards! For the life of me I cannot find any good examples of SSIS and scripting that uses FTP wildcards to GET certain Files. In a nutshell, here's what I need to do...
    Query a SQL Server Database which has a parsed File Name, the first 50 characters of the file name.
    The Query "Result Set" is put into an Object Variable User::SQLServerFileList
    I then utilize a "Foreach Loop Container" which reads the User::SQLServerFileList and puts it into Variable User::SQLServerFileNm...which is again the first 50 characters of the File Name
    Within the "Foreach Loop Container", I then utilize an "Expression Task" which builds a variable User::RemoteFileLookup which is a concatenation of the User::RemoteFolderPath + User::SQLServerFileNm + the wildcard *(Variable
    User::RemoteWildCard)
    I then try and utilize a "FTP Task" to use that concatenated Variable to go and GET the Filename but every time I try, it does not like what I'm sending via the "FTP Task"
    Error: 0x0 at TF Secure FTP Task, ExecuteTask Failed:: Illegal characters in path.
    I realize I might have to do something like this via C#.
    My biggest challenge is providing the GET Command via the Remote FTP Site with a parsed Filename and utilizing a wildcard.
    mc7i1231_20140227_050114_27_05_02_09*.999
    And the Filename that exists on the FTP Server is...
    mc7i1231_20140227_050114_27_05_02_09_x12_a43419452ca844a9b8a00f61e655dca3.x12-20140303180032.999
    Can any gurus out there PLEASE help me out???
    Thanks in advance for your review and am hopeful for a reply.
    PSULionRP

    Hi PSULionRP,
    According to the document
    FTP Task, we can read that:
    The FTP task supports the ? and * wildcard characters in paths. This lets the task access multiple files. However, you can use wildcard characters only in the part of the path that specifies the file name. For example, C:\MyDirectory\*.txt is a valid
    path, but C:\*\MyText.txt is not.
    So, when you use expression tobuild the variable RemoteFolderPath, make sure the evaluated value of the expression conforms to the above rule. 
    Regards,
    Mike Yin
    TechNet Community Support

  • Wildcards in Query selection filter

    Friends,
    We are using BW 3.0B and wanted to have Query selection to accept wildcard characters to material characteristic.  upon searching I could not find the selection option "Pattern" either when I create a variable or at Query user selection 'Selection Options'.  All I see is only following 5 options
    1) Single value
    2) Greater than or equal to
    3) Less than or equal to
    4) Greater than and
    5) Less than
    If anyone has any comments please post it..
    by the way this Inobject has NO "Conversion Routine" at InfoObject level..
    Regards
    Mavi

    Hi Mavi,
    I hope you did not use the word PATTERN in there..
    By pattern i mean the string u r trying to search..
    eg: We used TF* in the variable screen to select all values starting with TF..
    In case of doc numbers we used 3000* to get all document numbers in the 3000 series..
    Hope this makes it clear..Let me know..coz this works for sure..
    Ashish..

  • Vague error message when using wildcards in a numeric search field

    Dear forum readers,
    When a user submits a search string containing a wildcard (e.g. 64%) in a numeric search field of a JHeadstart generated search section, the application returns with an error message like "For input string: %2".
    I'd like to show a more user-friendly message e.g. "Wildcard characters are not allowed in search field blablabla".
    Any suggestions on how this can be achieved would be most welcome.
    Regards,
    Ibrahim

    Well, I believe JHeadstart does not really have this functionality.
    One way is use a Query Operator 'startsWith', but then you always query like LIKE '<entered search value>%'
    This is probably not what you want...
    But you could hack it into advancedSearch in YourApplicationModuleImpl
    try {
    if (viewCriterium.getQueryValue() != null) { //This is where exception JHS-00116 is raised...
    value = viewCriterium.getQueryValue().toString();
    } else {
    value = null;
    catch (NumberFormatException ex) {
    //insert check for wildcard
    value = viewCriterium.getValue().toString();
    if (value.indexOf('%')>=0) {          
    sLog.debug("Ja, een wildcard!!!");
    operator = "LIKE";
    } else {//original exceptionhandling code here...
    ...and a bit later, add test for "LIKE":
    if (viewCriterium.isDate() || viewCriterium.isString() || "LIKE".equals(operator)) {
    value = "'" + value + "'";
    very nasty code, and does not raise an exception for searches like '%xxx'
    Good luck,
    HJH
    Edited by: HJHorst on Mar 5, 2009 12:03 AM

  • Crystal Reports - Wildcard in Command parameter

    This is what i use now
    {Command.COUNTRY} like {?Country}
    ?Country is a value entered by the user, this could be upper case or lower case and could be part of the country name.
    What is the crystal reports equivalent to achieve the above.
    something like
    caseinsensitive {Command.COUNTRY} like {%?Country%}
    CStr did not work do did
    {Command.COUNTRY} like  '%'{?Country}'%'

    Things are a little different in CR...
    #1) The wildcard you're looking for is "*" not "%"
    #2) Use the "&" to concatenate strings. Save the "+" for addition
    #3) Using a hard coded string, the formula would look like this...
    {Command.COUNTRY} like "*erman*"
    #4) Unfortunately, sticking wildcard characters to either end of a parameter doesn't work the same as it does with hard coded values.
    #5) Fortunately, you're using a command... So #4 doesn't matter... Assuming of course that you are trying to create a record selection formula.
    #6) You're do doing your record selection in the wrong place... If you're using a command, you need to add the parameter to the WHERE clause of your SQL query...Again, working with the assumption that this is for record selection.
    #7) How to accomplish #6...
    - 1) Right click and choose Edit... to open the command in edit mode.
    - 2) Add the parameter to the parameter list. Make sure to spell it EXACTLY the same as you have it spelled in the designer (otherwise you'll create a 2nd, unrelated parameter)
    - 3) Add or modify the WHERE clause to the command SQL. In your case (assuming MS SQLServer based on the syntax you posted).
    It should look something like this...
    WHERE TableName.Country LIKE '%{?Country}%'
    CR will drop the parameter values into the SQL replacing the parameter name with the parameter value before sending it to the server. No need to write dynamic SQL!!!
    The code sent to the server would look something like this...
    WHERE TableName.Country LIKE '%Germany%'
    #8) If you're wandering why it matters or why you don't want to use the Selection Expert when using a command?
    Answer: When you use a command, CR is no longer able to push it's logic back to the server. So the command will pull EVERY record without any filtering back to your local workstation where it will be filtered locally. Adding the where clause to the command itself avoids the issue altogether.
    HTH,
    Jason

Maybe you are looking for

  • My downloads of iTunes and related software onto my Windows PC fails every time with error message that the software does not have valid signature.  How to get around this problem?

    I have trouble downloading iTunes software and related software like the new ios8 on both my desktop--Windows 7, and my laptop--Windows Vista, because I keep getting error messages saying the software has been deleted because invalid signature.   I h

  • "Widescreen" filter on Dip to Color Dissolve?

    I've applied the widescreen filter to two clips -- then now, I want to put a dip to white color dissolve between the two clips. But when I do it, the actual white isn't widescreen like the two clips and it looks odd. How can I apply the widescreen fi

  • Video Playback

    I have a Macbookpro, when i watch videos on youtube its really choppy and appears to be in negative. I have the latest adobe flash player and my macbook if up to date as well. I don't know what happened because it was working just fine three days ago

  • Character Input

    Hello Everyone If someone is able to assist me that would be great, my problem is that i am trying to get my code to produce the reverse string only if the letter 'B' is input but i have been fiddling around and cant get it to compile for me. Is ther

  • How to open ports 2078 and 2077

    I can't seem to figure out how to do this. I need it for a webdisk for my site but can't get these 2 porst to open so it can connect. any help on how/where I go to do this?