Case-Insensitive File Name Search on Unix

Hello,
I have a program which runs on a Unix OS and it looks for some files like file.csv, and then reads these files. Basically I know the file name and I look for that file name in a particular directory.
Now, I want to make my program case-insensitive so that if the file name is file.csv or File.csv or FILE.csv, it should still locate that file and read it.
Any advice....
Thanks.

Thanks.
Probably I have to get all the file names in that
directory and then try to match against the file name
(using ignore case or toUpperCase() maybe), which I
am looking for.
Is there a way, where I don't have to get all the
file names in that directory and can just go and get
the FileReader Object etc for the file which I am
looking for.No
/Kaj

Similar Messages

  • Case Insensitive File Names in Sender File Adapter

    Hi,
    I've tried my best to search SDN on this issue with no help...
    My sender file name can have any case (upper or lower) e.g.
    ABC_123.txt
    or
    ABc_345.txt
    or
    aBC_456.txt
    However configuring the file name in the sender file channel as 'ABC*' did not work
    only files with name starting with the capital letters ABC got picked up and lower case did not get picked up...
    any suggestions on how this can be overcome
    Thanks
    Bharath Sai

    what if my file name has to be F0215DBFR* ??
    should I give 4*4 = 16 combinations ?
    looks funny... but feasible..
    was hoping SAP has a standard solution like
    [Ff]0215[Dd][Bb][Ff][Rr]* ?
    Anywise.. thanks a lot for your help Satish.. will use this technique (16 combinations for my req..)
    Edited by: Bharath Sai R on Sep 25, 2009 4:37 PM

  • Case Sensitive File Names

    Hi...
    I've been trying out the trial version of RH8, before
    upgrading from RH7. One of the problems I have noticed is the
    option to "Use Lowercase File Names (Recommended for UNIX)" in the
    Single Source Layouts setting, only works for actual pages in the
    project. As i have a number of PDF's as baggage files (that now get
    indexed), when they are returned in the search results, I just get
    a "Not Found" error. This is because it is not correctly putting
    the folder names or file names in lower case.
    Does anyone know a solution or workaround for this? (aside
    from renaming all files/folders!). Or know where I can submit this
    as a bug?
    Thanks...

    Bug/Feature requests can be filed
    here..
    As a workaround, you could try renaming your baggage files - for
    example File.pdf to file1.pdf and then to file.pdf. You'd need ot
    delete and add the baggage file references though. An alternative
    is to exclude the baggage file type from the search. You can find
    out how to do this from the latest post on my blog.

  • Reading file names in the unix box

    Hello,
    I did the following to read the files from the local directory.
    String s1 = "c:\samplefiles"
    File dir = new File(s1);
    if(dir.isDirectory())
    String listoffiles [] = dir.list();
    for(int i = 0; i <listoffiles.length ; i++)
    System.out.println(listoffiles);
    else
    System.out.println("Its not a directory");
    How can i read and print the file names in the unix box?
    Thank You.
    Kumar

    Thank You for the reply.
    In my custom page, i am trying to include a search page which includes date parameters based on which the pdf files in the unix box should be displayed in the page as a list. (The pdf file names start with the date).
    Once the user clicks the file names displayed in the page, i need to open the pdf. This part i can handle but to search the file names based on the parameter names and display in the page as the list is a bit confusing.
    Thank You.

  • Case insensitive in-memory search

    I'm trying to create a case-insensitive in-memory search on a ViewObject. I'm using the following code for performing an in-memory search (~ filtering already retrieved rows from the ViewObject which is based on a webservice)
    ViewObject vo = service.getMyViewObject();
    vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
    ViewCriteria vc = vo.createViewCriteria();
    vc.setCriteriaMode(ViewCriteria.CRITERIA_MODE_CACHE);
    ViewCriteriaRow vcr = vc.createViewCriteriaRow();
    vcr.setAttribute("MyAttribute", "like 'abc%' ");
    vc.add(vcr);
    vo.applyViewCriteria(vc);
    vo.executeQuery();This all works well .. but when I add vcr.setUpperColumns(true); and change line vcr.setAttribute("MyAttribute", "like 'abc%' "); into vcr.setAttribute("MyAttribute", "like 'ABC%' ");I get the following exception :
    Caused by: oracle.jbo.expr.JIException: Method call has no object context
         at oracle.jbo.expr.JIParserMethodNode.evaluate(JIParserMethodNode.java:71)
         at oracle.jbo.expr.JIParserNode.evaluate(JIParserNode.java:740)
         at oracle.jbo.RowMatch.rowQualifies(RowMatch.java:230)
         at oracle.jbo.server.ViewObjectImpl.rowQualifies(ViewObjectImpl.java:1387)
         at oracle.jbo.server.QueryCollection.rowQualifies(QueryCollection.java:2308)
         at oracle.jbo.server.QueryCollection.removeUnqualifiedRows(QueryCollection.java:549)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:719)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)So, my question is: is it possible to do a case-insensitive in-memory search or should I convince my customer to drop the feature-request ;-)

    Maybe I should add some extra info:
    The viewobject is based on a webservice and not a database. I do not have access to the implementation of that webservice ( I only consume its data and store the results in the viewobject's datacollection ). The VO has no query attached and only has transient attributes. Therefore, I cannot use vo.setWhereClause() ~ I think.
    Once I filled the viewobject's datacollection ( by overriding executeQueryForCollection() and createRowFromResultSet(...) ), I would like to filter the datacollection with filterparameters (from my jsf page). This can be enabled by first calling vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS) an
    The in-memory search facility in the ViewObject's implementation seems to be restricted in filtering the viewobject's datacollection.
    I've tried using ViewCriteria and RowMatch to filter the data ... with no success.
    I hope I have explained my situation a bit more. Perhaps someone can help me out ?

  • Specifying Case-Insensitive Element Names in XML Schema

    Hope someone knows this!
    Is it possible to define an an XML Schema Definition so that Element names in the target XML File can be case insensitive.
    At the moment my Parser throws an error if the element names in the XML file do not have the exact same case as the definition in the XML schema.
    E.g
    In Schema i have:
    <xsd:element name="HOSTINVENTORYLINE" type="HostInventoryLineType" maxOccurs="unbounded" minOccurs="0"/>
    but in xml file i have
    <HostInventoryLine field=""/>
    or
    <hostinventoryline field=""/>
    Does anyone know anyway to get around this, so that the parser accepts the HostInventoryLine element in the xml as an instance of the HOSTINVENTORYLINE element defined in the schema.
    Thanks in Advance
    JJ
    Message was edited by:
    [email protected]

    You could use substitution groups to handle this. You would need an entry in the schema for each valid capitalization. This won't scale well if you want to be completely case insensitive, but if you only support lower case, upper case, and camel case it should do the trick.
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:complexType name="HostInventoryLineType">
              <xs:sequence>
                   <xs:element name="an-element" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="HostInventoryLine" type="HostInventoryLineType"/>
         <xs:element name="HOSTINVENTORYLINE" type="HostInventoryLineType" substitutionGroup="HostInventoryLine"/>
         <xs:element name="hostinventoryline" type="HostInventoryLineType" substitutionGroup="HostInventoryLine"/>
    </xs:schema>-Blaise

  • How to create case-insensitive account name report?

    We have an account report that allows users to enter part of an account name and return matching results. The prompt is case sensitive but I would like it to be case insensitive. This report uses a report prompt and not a dashboard prompt (if it makes a difference), and I can switch to dashboard prompt if necessary.
    Since the left pane search for Account Name is case-insensitive and you can select case-insensitive when creating account list views, I am hoping there is a way to apply this same functionality to a report.
    I understand I can convert Account Name to upper or lower and tell people to search that way, but that will be a last resort.
    Any suggestions on how to make the prompt value and report results for Account Name case-insensitive?
    Thanks.
    Edited by: user9530733 on Sep 30, 2010 10:51 AM

    Similarly to all this, and even what the OP is looking to accomplish, is the habit of developers attempting to coerce the database object names into the format of their language - usually .net or some such. So they create tables named something like EmpDepProjectStatus which may make their application code all look consistent, but becomes EMPDEPPROJECTSTATUS when created in the database. Why can they not adapt to the database and name the table EMP_DEP_PROJECT_STATUS so that we do not go blind trying to manage their db objects? Is it their teachers that tell them EveryThingMustBeWrittenLikeThisBecauseTheyCannotStandSeperatingTheWordsThatNameObjectsWithSpaces_WHICH_ARE_UNDERSCORES_IN_MOST_ALL_LEGACY_LANGUAGES?
    I do not think that Oracle will ever become case sensitive. Just like COBOL, IMS, IDMS, JCL, BASIC, PL/I, etc. There is just too much code out there that ignores case that it could not be done.
    Unless, of course, Oracle creates a init.ora option to set case sensitive. But I doubt (hope most sincerely) that they will never do that.

  • How to store the File Name from a Unix Directory into a ODI variable?

    Hi,
    I have built a ODI package with the following steps:
    1. ODI is polling for a flat file in a Unix directory. I have used OdiFileWait tool for this purpose. Here the file name is not fixed, so I am using wild character (*) to poll for file. Example: DF*ABC1*.DAT where the first wild character denotes 1 letter and the second wild character denotes 2 digits.
    2. In the second step, if the file is found, I am moving the file to ODI file server path (../oracledi/demo/file). Here I have used ODIFileMove tool.
    3. Then I am using an ODI Interface to Load the file data into a Oracle database table.
    4. I am using a Process log table to keep the log for each step I am executing in ODI that is ODIFileWait, ODIFileMove, Interface etc. for each file. In this table a row needs to be inserted after ODIFileWait tool gets the file, with the File Name and File Date. Later on this row will be updated as the consequent steps are executed.
    Here is my concern, I need to get the exact File Name of the file after ODIFileWait gets the file and I need to insert that in the Process Log table after the ODIFileWait step gets a file. So if I can store the File Name in a ODI Variable, I can insert it into the Process log table at this point. This I am not able to do.
    The files are coming in a different directory (not in ODI file server path), So after getting the file it is moved to ODI file server path (../oracledi/demo/file)
    The Files which I am processing are fixed length format. Also, the File name and File Date is stored in the 1st Record(Header record) of the files.
    Kindly provide me suggestions to implement this in my code.
    Thanks and Regards,
    Anik
    Edited by: 809820 on Nov 10, 2010 11:36 PM

    Look at this link -http://odiexperts.com/getting-one-or-several-unknown-files-from-a-directory
    change the command to fetch the ls command and write into File and then using either java or jython break the data and fetch the file name and date and insert into log table.
    (or)
    you can use the os.system command and get the complete ls command into string and then process and insert it.
    Let us know if you need any other help.

  • UTL_FILE & User Input: Case Sensitive File Names

    Hi.
    I'm trying to reduce problems due to the whether the user uses upper or lower case or combo of them in entering file names.
    Scenario is:
    Existing file to be read: Orig_File.Txt (file name changes daily)
    Output to be saved into file: RESULTS_FILE.TXT
    In response to PL/SQL commands (please see below), the user enters:
    ORIG_FILE.TXT and Results_FILE.txt
    as the Input & Output file names. The problem is that the input file has been saved using Upper and Lower case and I get back a file not found error.
    Is there a way to call a file with is a different case than the input?
    Thanks.
    Current commands are:
    In_File          UTL__File.file_type;
    Out_File          UTL__File.file_type;
    Curr_Line     VarChar2(2000);
    BEGIN
    In_File := UTL__File.fopen('UTIL_FILE_DIR', '&input_file', 'R', 2048);
    Out_File := UTL__File.fopen('UTIL_FILE_DIR', '&output_file', 'W', 2048);
    LOOP
    BEGIN
    UTL__File.get_line(In_File, Curr_Line, 2048);
    .......

    A shell script would typically issue something along the lines of
    newfile=$(ls -C1 | grep -i "\&lt;${filename}\>")although of course it is possible for this to match multiple filenames, so it would have to check for that scenario and report it as an error. possibly you could call a shell script like this from PL/SQL via Java or DBMS_SCHEDULER. Good luck with that though.

  • Upper case file name in linux/unix env

      Hi All,
    Can anyone please let me know if it is possible to generate pdf names in capital in linux/unix env?? I am able to generate it fine in windows but it always generates in  lower in unix.
    Thanks.

    No, all files used or produced by Documaker on unix platforms will be lower case. Of course, there's nothing to prevent you from renaming the PDF file after it is produced.

  • Case insensitive query or search in Form

    Hi,
    I have created a form based on a table. If i fill any of the field and then clicks the Query button for saerch it give me the record but it is case sensitive. How can i get this functionality ir-respectative of upeer-case or lower-case.
    Thanks in advance.
    Ejaz

    In the onQuery procedure you find this code:
    if "_convert" and "_operator" is not null then
    "_value" := replace("_value",'''','''''');
    "_where" := "_where" ||'ENAME' || "_operator" || ''''|| "_value" ||''' and ';
    elsif "_convert" and "_operator" is null then
    "_value" := replace("_value",'''','''''');
    "_where" := "_where" ||'ENAME like '''|| "_value" ||''' and ';
    elsif not "_convert" then
    "_where" := "_where" ||'ENAME '|| "_value" ||' and ';
    end if;
    You should modify this to get what you want. However be warned that changing the generated package is not supported and any changes will be lost on regenerating the component.
    Regards,
    Hsiu

  • A way to search System Files and by File Name as default?

    Hello.
    Is there a way I can make the default search both include searching by File Name and searching System Files?
    I know I can make a saved search, but this just is one extra step. I'd like to the default behavior of the Finder be to search system files, and default to searching by File Name rather than contents.
    Thanks.

    If you bring up the Finder window search using Command-Shift-F you will get the default of a file name search (unfortunately it has no criteria whatsoever, so if you want to modify the search with an added criterion you have to click the wee little + icon).
    There is no way to automatically include system files.
    Francine
    Francine
    Schwieder

  • Case-insensitive Search with Search Form

    I am using a Search Form with a UIX Page. One of the issue that need to be resolved is to be able to do case-insensitive search for text information stored in some database columns. Please advise me how to implement case_insensitive search with JDeveloper's Search Form.
    Thanks in advance,

    Hi Qian,
    This article (below) by Steve Muench explains how you can customize Query by example behaviour of ADF BCs and if you really want, how to create your own ViewCriteriaAdapter (but you don't have to go quite that far - luckily :) ).
    http://radio.weblogs.com/0118231/2005/02/10.html#a492
    Here is what I did. I implemented the following method in my base view object class (MyBaseViewObject). Note that this code is based on a piece of code that Steve posted on his blog (http://radio.weblogs.com/0118231/stories/2003/07/11/implementingAViewCriteriaAdapterToCustomizeQueryByExampleFunctionality.html); originally an example about creating your own ViewCriteriaAdapter.
    Since applyViewCriteria(oracle.jbo.ViewCriteria) is used by the query-by-example mechanism you're able to "intercept" the ViewCriteria on "it's way in". After that the standard ViewCriteria does it's job as ususal and generated the where clause when required.
    public void applyViewCriteria(ViewCriteria vc)
         if( null == vc || vc.size() == 0 ) super.applyViewCriteria(vc);
         ViewCriteriaRow criteriaRow = (ViewCriteriaRow)vc.first();
         StructureDef def = criteriaRow.getStructureDef();
         AttributeDef[] attrs = def.getAttributeDefs();
         System.out.println(getClass().getName() + ": applyViewCriteria()");
         boolean bFirst = true;
         do{
           if(vc.hasNext() && !bFirst) criteriaRow = (ViewCriteriaRow)vc.next();
           criteriaRow.setUpperColumns(true);
           for (int j = 0, attrCt = attrs.length; j < attrCt; j++)
             String criteriaAttrVal = ((String)criteriaRow.getAttribute(j));
             if (criteriaAttrVal != null && !criteriaAttrVal.equals("") && !JboTypeMap.isNumericType(attrs[j].getSQLType()))
              criteriaRow.setAttribute(j,criteriaAttrVal.toUpperCase());
           bFirst=false;
         }while(vc.hasNext());
         super.applyViewCriteria(vc);
    NOTE that doing this makes all your views case insensitive (to vc search) you may want to implement more functionality in your base view object to set whether a view is in case insensitive mode or not.
    ALSO that flag will not be passivated (if I remember correctly - someone correct me if I'm wrong) so you'll have to add that flag to the passivated data.
    Cheers!
    Sacha

  • Case insensitive searching for criteria "All metadata"

    If I'm specifically searching in (for example) keywords, then the search is case insensitive. However, if I'm searching "All metadata" then the search is case sensitive. I don't know if this is a bug or a feature (seems like a bug to me), but I'd really prefer it to remain case insensitive for this search criterion as well.
    While I'm at it, I'd like to be able to search the IPTC headline.
    Bart

    I'll second that request on both counts! In fact, I'd like to see the ability to search based on any XMP field.
    -Andrew

  • XMLIndex - case insensitive search ?

    When creating an XMLIndex, is there an option to create it as case-insensitive, so any searches based on that will ignore case ?
    My business requirement is that a search, e.g. for 'bank', should match bank, Bank, BANK, etc. ignoring case.
    I could put a TO_UPPER around all my comparisons, but my concern then is that the XMLindex will get ignored and I end with with full table scans all the time.

    If I am not mistaken, you can create an function based index as an extra layer on top of the XMLIndex / Path Table...

Maybe you are looking for

  • Import dtw batches

    Hi, I am a newbie (first implementation) and I need to implement a SKU reader in the warehouse. The SKU reader can provide me with a file that will be on a computer. I will need to read the file and process an import for PO and AR. What are the basic

  • WriteToTextFile -- how to prompt ONCE??

    how do i get (text) File I/O VI's to prompt only ONCE for a filepath and then use that from then on? if i leave FilePath unwired, (because i want the user prompted) i get prompted for file location on EACH ITERATION, even with "Append" wired True. th

  • Thai language - create pdf from webpage

    acrobat x 10 pro - win 7 pro I can not create a pdf from a thai webpage. There is no import from Thai Fonts. Even with Default Encoding set to Thai and language spedific font settings to unicode. I do not see a language specific font settings : langu

  • Keynote to Quicktime export

    I currently have keynote '09 and am having trouble producing a video that works on an HD TV. It does not seem to matter whether I use 1280x720 or 1920x1080 when I export it as a quicktime movie and specify HD the movie never plays right on the TV. It

  • Front Row not finding iTunes?

    I recently moved all my music to an external hard drive, and since then, I haven't been able to use Front Row. The application starts up perfectly, but when I go to find any music to play, it says there is no music to be found. The message that pops