Making It Case Insensitive

Hi All,
Deepak here
I am working on a code to match the particular pattern in the File.
I do have the code for it but its case sensitive can any tell me how do i make it case in-sensitive
I have the code bellow
import java.io.*;
import java.util.regex.*;
public class FileMatcher
     public static void findMatchedLines( final File aFile,final File fout,FileWriter outs )
     Pattern regexp = Pattern.compile("Name");               //Compile the Pattern to be used by Matcher.
     Matcher matcher = regexp.matcher("");     // <----- Doubt Here //using regex to match it to the data in the File
     LineNumberReader lineReader = null;
          try
          lineReader = new LineNumberReader( new FileReader(aFile) ); //LineNumberReader reads Line on File,
          lineWriter = new LineWriter(args[1])                                        // used to specify Line @ which match Found
          String line = null;
          while ((line = lineReader.readLine()) != null)          //Reader the Line of File.
     {          System.out.println("Line="+line);
          matcher.reset( line );                          //reset the input
          if ( matcher.find() )                         //Callin Find method 4 results of comparision.
          outs.write(line);     
               //String msg = "Line " + lineReader.getLineNumber() + " is Matched: " + line;//Displable Msg.
          //throw new IllegalStateException(msg);
               //System.out.println(msg);                    //Displaying the Msg
               else
                    System.out.println("Match Not Found");          //Else Case
     catch (FileNotFoundException ex)
     ex.printStackTrace();
     catch (IOException ex)
     ex.printStackTrace();
     finally
     try
     if (lineReader!= null) lineReader.close();
     catch (IOException ex)
     ex.printStackTrace();
public static void main (String [] args)
final File fin=new File(args[0]);               //Creating the File object with name obtained from argument.
File fout=new File(args[1]);
try
FileWriter outs=new FileWriter(fout);
FileMatcher.findMatchedLines(fin,fout,outs);               //call user-defined findMatchedLines method with input File Object.
//FileMatcher.findMatchedLines(fin,fout);
catch(IOException e)
}                                        //final File fout=new File(args[1]);
                                        //FileWriter outs=new FileWriter(fout);
Need Help !!!
Cheers
Deepak

All you do is compare in the same case i.e. temporarily convert what you are comparing into the same case as what it is being compared with. There are API methods for this. Dont quote me on this but I think (from memory) they are part of the String package and they are to toUpper() and toLower() but like i said thats from memory so best if you look it up in the API docs yourself.
so...
if( yourregexpr.toUpper().equals(stringBeingChecked.toUpper()) ){
   //do whatever
}

Similar Messages

  • Making ADF Search case insensitive without using Execute with Params??

    I have a ADF search page baed on VO. I'm not Execute with Params form, instead i'm using normal ADF search page. Is it possible to make the search case insensitive?? if yes, how to do that?

    Ok, i'll try to find out the SRDemo application using ADF BC.
    And In Execute with params form,i'm already using UPPER on both the sides of where clause.
    Say my VO query is like
    select <table name>,...
    from fnd_tables t,fnd_applications a
    where a.application_id = t.application_id
    and upper(t.table_name) like upper(:EntityName) || '%'
    Then i created the ADF paramaters form by dragging and dropping the Execute with param from data control pallette.. when i run this page and do the search, it throws the error given in my second update...Any clue why that error is coming?
    Thanks
    Senthil

  • Case-Insensitive Searching on Content Server

    Hello everyone,
    I have a Content Server 10gr3 using an Oracle 11g DB. All of my searches are case sensitive, but we need case-insensitive searching. I've tried changing the DatabasePreserveCase variable in the config.cfg to 1, 0, true, and false, rebuilt the indexes in between each reboot (not sure if that's necessary or not), tried checking in new documents after making the changes and searching for those, but no matter, searches stay case sensitive.
    We have another UCM install running on a 10.2.0.3.0 DB, and case insensitivity works on that Content Server with DatabasePreserveCase=1.
    What could we be doing wrong? I've found several documents which have stated that case-insensitivity is impossible with an Oracle DB, but I think those are all old and from before Oracle's acquisition of the product (and obviously it is possible, since we have another install with it working).
    Thanks in advance for any help you can give!

    I'm not quite sure what you mean by Search Engine... we simply installed the Oracle 11g Database, then installed Content Server and configured it to run using that database. We haven't done anything with full-text search.
    Edit: Do you mean the SearchIndexerEngineName value in the config file? It's DATABASE.METADATA, though at some point we also need to get full-text up and running which to my understanding requires it to be DATABASE.FULLTEXT.
    As to the OracleCaseInsensitiveSearch component, where can I find it? Google shows up nothing, and MetaLink has one page saying that it exists but nothing more...
    Message was edited by:
    user573973

  • Possible to do case-insensitive searches?

    G'day,
    I was wondering if it's possible to do case-insensitive searches in oracle/HTMLDB?
    I've tried what I thought would work
    "select * from application where name like '%microsoft%'", this unfortunately doesn't return any records with a capital in it(eg "Microsoft").
    If there is no way to do case-insensitive searches what is the best way around it?
    Thanks
    -Colin

    Colin,
    Yes it is possible to do case insensitive searches using SQL. Try, for example:
    select * from application where upper(name) like '%ORACLE%'
    The trick is to upper() both sides of the like operator.
    Sergio

  • Error in a report after enabling case insensitive search in conn pool prop

    Hi All,
    I put the below code in connection pool's connection string to enable case insensitive search.
    alter session set NLS_SORT=BINARY_CI
    alter session set NLS_COMP=LINGUISTIC
    After putting this code one of my report started giving the below error which was working fine otherwise.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. NQODBC SQL_STATE: HY000 nQSError: 10058 A general error has occurred. nQSError: 16001 ODBC error state: S1000 code: 1791 message: OracleODBCOraORA-01791: not a SELECTed expression. nQSError: 16001 ODBC error state: S1000 code: 1791 message: OracleODBCOraORA-01791: not a SELECTed expression. nQSError: 16015 SQL statement execution failed. (HY000)
    The report gives error for the below divide condition when I select a column from a different dimension (eg: region)
    COUNT(DISTINCT RMA.RMA)/COUNT(DISTINCT User."User Name")
    Can anyone please throw a light why this is happening.

    Below is the SQL which is throwing error in OBIEE. It was working fine when I tried running it in toad:
    select T1609.ATTRIB_05 as c1,
    count(distinct T1609.ATTRIB_42) as c2,
    TRUNC(T1159.FSCL_WEEK_START_DT) as c3
    from
    WC_DAY_D T1159 /* RMA_RECEIVED_DT(WC_DAY_D) */ ,
    WC_RMA_D T571,
    WC_FV_FA_D T1609,
    WC_FV_FA_F T1679
    where ( T571.ROW_WID = T1679.RMA_WID and T1159.ROW_WID = T1679.RMA_RECEIVED_WID and T1609.ROW_WID = T1679.FV_FA_WID and T1609.ATTRIB_39 <> 'FV' and (T571.STATUS_CD in ('2nd FA', '2nd FA Review', 'Closed')) and TRUNC(T1609.TODO_ACTL_END_DT) is not null and TRUNC(T1159.FSCL_WEEK_START_DT) between TIMESTAMP '2009-03-22 00:00:00' and TIMESTAMP '2009-04-12 00:00:00' )
    group by T1609.ATTRIB_05, TRUNC(T1159.FSCL_WEEK_START_DT)
    order by c3
    -------------------- Query Status: Query Failed: [nQSError: 16001] ODBC error state: S1000 code: 1791 message: [Oracle][ODBC][Ora]ORA-01791: not a SELECTed expression.
    [nQSError: 16001] ODBC error state: S1000 code: 1791 message: [Oracle][ODBC][Ora]ORA-01791: not a SELECTed expression.
    [nQSError: 16015] SQL statement execution failed.

  • How to change Database server is case-insensitive setting at runtime

    Is there a way to change any of the properties in Report Options > General Settings at runtime. Mainly the [Database server is case-insensitive] and [Perform grouping on server] settings. We are using the Crystal .Net X1 runtimes (11.5.9707.811). I have sesrched the forums with no luck so thought I'd try my luck here. Thankyou for your time.

    Hi Simon,
    Sorry, search for the function using the Object Browser in .NET. If you have Crsytal Reports XI R2 (11.5.x.xxxx) then you have it. Unless it's not a developer version. In whcih case you need to upgrade.
    If you do have the Developer version then simply add the RAS assemblies to your project. Look in our samples above for more info on h ow to use RAS.
    If you don't have the Developer version then your only options are to upgrade or manually change the report settings in the Designer.
    Thank you
    Don

  • How do I move my large iTunes collection from a case-sensitive hard drive to a case-insensitive hard drive?

    I currently keep my iTunes media on an external hard drive because it takes up too much space on my machine. I recently discovered that it was formatted as case-sensitive when I bought it, and now months later I'm having issues. When attempting to back up my files on a case-insensitive hard drive, the operation failed due to conflicting file/folder names (Artist and artist are now considered the same file name and one would have to overwrite the other). I now have a large iTunes file collection that is stuck on the case-sensitive hard drive, and I want to save a backup on a case-insensitive drive. 
    Is there a way to identify all cases where multiple files/folders have the same title/album/artist but different spelling so there will be no conflicts? The folder/file names would have to be crossed referenced to highlight any cases where File/fiLe/file  would cause a problem.
    I imagine there is a way to do this using iTunes script or Automator  or a command in terminal or something rather than going through and checking/fixing all the information for thousands of songs by hand. I'm at the limits of my minimal development skills, so any help would be appreciated.

    You should be able to use either "Carbon Copy Cloner" or "SuperDuper" (free for this purpose) to copy your case-sensitive volume to an empty case-insensitive one. Make at least two such copies on different drives. One is not enough to be safe.
    If there are any name conflicts—that is, files in the same folder with names that differ only in case, such as "File" and "file"—then you will either get an error or one of the files won't be copied. You must ensure either that no such conflicts exist, or that the consequences are not important. How you do that is up to you. Unless you went out of your way to create conflicts, they probably don't exist.
    Then erase the source volume in Disk Utility as case-insensitive. This action will remove all data from the volume.
    Restore from one of your backups using the same application you used to create it, or use the "Restore" feature of Disk Utility, which will be faster. Search its built-in help for the term "duplicate" if you need instructions.

  • Time Machine says both of my external hard drives require reformatting to case insensitive. What do I do?

    I have been successfuly using Time Machine to back my iMac  to an external hard drive (via usb) and everything has been fine for the last year. I have been using TM to back up to a HD called Terra LaCie via usb.
    A week ago, my iMac hard drive was full--so I spulrged and bought a 6 TB external hard drive (Western Digital My Book-Thunderbolt). I set up the new Thunderbold HD to use RAID 1 (mirror) and copied most of my iMac hard drive over to the Thunderbolt HD.
    I kept my working photographs (most recent) on my iMac and felt good to know my older photographs are on my new Thunderbolt hard drive.
    For a few days, Time Machine seemed to work fine (backing up my iMac to Terra LaCie HD. I haven't been concerned with backing up the Thunderbolt drive (as I feel that mirroring is same as backing up).
    Yesterday, Time Machine indicated the lastest back-up failed (for the HD called Terra LaCie). Now, when I go into Time Machine, the dialog box indicates the following message:
    "Are you sure you want to erase the backup disk “Terra Lacie”? Erasing will destroy all information on the disk and can’t be undone.
    The disk must be erased before it can be used for Time Machine backups because a disk you are backing up is case sensitive, but the backup disk is not."
    When I open Time Machine to look at my external hard drives (I also have a third usb portable drive); two of the three drives indicate the following:
    "reformat required; case insensitive disk".
    The small, portable hard drive (that I'm also using) doesn't say it needs to be reformated (but my new Thunderbolt and my old usb HD both indicate the same message (above).
    What should I do? I just spent days transferring my photographs from my iMac to my new Thunderbolt. Should I just not use Time Machine any longer and work from my Thunderbolt drive?
    Am I to understand that my iMac suddenly become case sensitive? Sorry if this was too much information about my hard-ware set-up.
    Any help someone can provide me would be greatly appreciated. I suppose I need to understand Time Machine and perhaps my Thunderbolt better.

    Hi BDAqua,
    Bravo, you helped me solve my problem.
    The Case Sensitive Disk was the small portable hard drive that I was using termporarily.
    I just disconnected it and I started TM machine and everything seems to be working just fine.
    Thank you very much!!!!

  • How do I convert a case sensitive drive to a case insensitive drive?

    I have recently purchased a MacMini Server, and installed the 2 internal hard drives in a RAID 0 configuration to obtain the speed and 1 TB capacity, but unfortunately (rather stupidly in retrospect) formatted the drive in case sensitive mode.
    On installing the operating system and multiple applications, everything seemed to work well until I tried to install Adobe Acrobat X Pro. This application refuses to install on a case sensitive formatted drive, which I now understand is a common problem.
    The question is how can I convert to a case insensitive format without reinstalling all of the software from scratch?
    I have a Time Machine backup, and the easiest thing for me would be to reformat the drive, and then restore from the Time Machine backup.
    Will this process work? Or will there be some complications and files that will not function if they were originally installed on a case sensitive drive?
    Any help is appreciated....

    iPartition can do it ( http://www.coriolis-systems.com/iPartition.php ).
    from iPartition Help:
    Make Case Sensitive/Case Insensitive
    HFS+ now supports a case sensitive format as well as the usual case insensitive format. On a case sensitive volume, the names “Readme”, “README” and “ReadMe” would all represent different files, even if they were in the same folder.
    This option allows you to non-destructively change a case sensitive volume into a case insensitive one, and vice-versa. If you are going from a case sensitive volume to a case insensitive volume, some of your files may be renamed automatically by iPartition so that they do not clash. If all of the files in the table below were in the same directory, the right hand column shows the new names iPartition would choose for them:
    Old name New name
    README.txt README.txt
    ReadMe.txt ReadMe 1.txt
    Readme.txt Readme 2.txt
    README README
    ReadMe ReadMe 1
    Readme Readme 2
    Notice that iPartition puts the number before any file extension.
    N.B. iPartition does not transform filenames with numbers on the end back into their original forms. There is no way to tell which files were renamed by the user and which were renamed by the conversion process.

  • 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

  • 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 can I copy media from an HFS case-sensitive drive to an HFS case-insensitive drive without getting an error?

    About a year ago, I accidentally created a partition on my drive for my iTunes Music. On that parition, called MUSIC, I selected the filesystem to be an HFS, Journaled, case-sensitive partition. Since then, all of my music, new and old, lives on the case-sensitive MUSIC parition.
    My other partition, called BOX, is an HFS, Journaled, case-insensitive filesystem, as are my external drives I use for archiving and backing up my music.
    My dilemma: when I try to copy my music/iTunes media from the MUSIC partition to a different partition that's case-insensitive, I obviously run into errors saying that certain files can't be copied because they will overwrite others. Subsequently, I can't back up my music and iTunes media to another drive unless it has the same filesystem parameters favoring case-sensitivity. I want to move my media to a case-insenstive drive/partition.
    As the story goes, I'd like to avoid having to reformat and worry about moving my media around because I feel, in the end, I'd end up doing more harm then good in my pursuit to fix this issue.
    My question: is there some way I can detect which files are conflicting with each other, and then manually rename them? My music library runs about 16,000 songs deep, but I'd still feel saved even if I had to go through and manually rename all of the music files so they don't conflict with each other in order to get them on to a case-insensitive drive. Perhaps there's an AppleScript someone knows about that I could execute in my MUSIC partition to see which files/directories are causing my problems? In other words, I'm thinking there could be a way to detect the same file/directory names that are only different soley because of their case.
    Any help, suggestions, or solutions are welcome. Thank you all for your time in helping me solve this!
    And have a Happy Thanksgiving

    How do I restore a case-sensitive,...: Apple Support Communities

  • SELECT Query to get the Values in Case insensitive Format

    Hi ,
    This is hari,
    I want to select the user name in a table ex: username="HARI" or username='Hari' or username="HaRi" like this
    If i wrote the query like
    select username from userdb where username="Hari";
    it is displaying the records which only matches "Hari" only .
    can anybody help me out on this query asap please....
    the query should return all the results
    which matches any of the following strings as inputs "HARI" or "HaRi" or "hAri" or the like.
    Awaiting for Response,
    Thanks & Regards
    Hari

    Another solution is setting NLS_SORT to CI - case insensitive (or whatever_your_language_is_CI) and NLS_COMP to ANSI:
    SQL> with t as (
      2             select 'HARI' name from dual union all
      3             select 'Hari' name from dual union all
      4             select 'HaRi' name from dual
      5            )
      6  select  *
      7    from  t
      8    where name = 'hArI'
      9  /
    no rows selected
    SQL> alter session set nls_sort = binary_ci
      2  /
    Session altered.
    SQL> alter session set nls_comp=ansi
      2  /
    Session altered.
    SQL> with t as (
      2             select 'HARI' name from dual union all
      3             select 'Hari' name from dual union all
      4             select 'HaRi' name from dual
      5            )
      6  select  *
      7    from  t
      8    where name = 'hArI'
      9  /
    NAME
    HARI
    Hari
    HaRi
    SQL> SY.

  • Case-insensitive -- what's a scriptor to do?

    Here's my delima: (from a tcsh)
    % ls
    file1.txt file2.TXT file3.txt
    % ls file{1,2,3}.TXT
    file1.TXT file2.TXT file3.TXT
    % ls *.TXT
    file2.TXT
    % rm *.txt
    I've written hundreds of unix (csh,tcsh, perl) scripts since around 1988. I never considered that some day UNIX would ignore case in filenames.
    As you can imagine, I'm going to have to re-write dozens of scripts, now that I have this case-insensitive "feature".
    QUESTION 1: Is there some way to turn off the ignore-case in Apple unix? What are the consequences of such a bold act?
    QUESTION 2: Is there a simple variable, switch, or something, that tells the shell (tcsh) that files are case-sensitive (e.g. *.TXT would match *.txt)? Same request goes for telling filec that is should ignore case.
    PowerBook G4   Mac OS X (10.3.9)  

    Hi Bill,
       I see what you're saying. When the shell passes information to the filesystem, case ceases to matter. However, C Webber is talking about the reverse situation. HFS+ is case-insensitive but it is case-preserving. Whatever case is used in the naming of a file is reproduced faithfully in read operations and shells are by default case-sensitive. C Webber's example was filename globbing. The shell reads the names of the files and looks for matches in a case-sensitive fashion. In that case, case will matter.
       I can see where this would cause problems. You might test for the existence of a file in a case-sensitive fashion, find out that it doesn't, write to the filesystem and blow away a file even though you were careful. You know that something like that happened with the Perl install script, causing it to blow away dozens of its own man pages.
    C. Webber,
       I did a search of the tcsh man page and found nothing suggesting that you can turn off case-sensitivity in globbing. You can do so in completion but it appears that rewrites will be necessary. I encourage you to view this as an opportunity and switch to a more powerful shell. I agree with you that this issue is unique to Mac OS X but every flavor of UNIX has its own issues. We've all had to make changes to migrate scripts. I've certainly had to do that to migrate some of my scripts to Linux and some won't migrate at all. (I use AppleScript in many of my scripts)
    Gary
    ~~~~
       "The glory of creation is in its infinite diversity."
       "And in the way our differences combine to create meaning and beauty."
             -- Dr. Miranda Jones and Spock, "Is There in Truth No Beauty?",
                stardate 5630.8

  • How to make a sortable column in a table to do a case insensitive sort ?

    Hi :
    I am using Jdeveloper Studio Edition Version 11.1.1.1.0 and my table columns are sortable but i want to make sure that it case insensitive sort ,for example if i have following column values :
    abc,def,ABC,ghi
    Sorted results should not be likes this : abc,def,ghi,ABC
    instead of this it should be like this : abc,ABC,def,ghi
    Please let me know more about it.
    Thanks
    AN

    Dear,
    I'm using the same configuration, Could u tell me how did u done the sort in a column in any case.
    Regards,
    RengarajR
    Edited by: Rengaraj Rengasamy on Oct 19, 2009 1:34 AM

Maybe you are looking for

  • Toshiba dynadock U issue

    I am having issues with the Toshiba dynadock U (PA3575U-1PRP.  When I installing the drivers for the docking station and click on the Internet, it takes forever for the homepage to appear.  When I turn off the Windows Firewall, that internet works gr

  • What is the VPN for Iphone 4s and do I need it?

    Just trying to figure out if it's important?

  • Do I have to have an Airport?

    I can't get my new Airport express to connect to my existing Netgear wireless network. Do I have to have an Apple Airport to make the connection? I am getting the flashing amber light. Thanks, Ben

  • 2.0.1 SnappierTM

    Yes, it's a cliche but 2.0.1 definitely seems snappier! Don't know how the other bugs are faring; time will tell. How about you?

  • About PostWrongEntries under BAPI_PROCORDCONF_CREATE_TT

    Dear PP guru, I have an enhancement program which used  BAPI_PROCORDCONF_CREATE_TT. The program work correctly but sometime some goods movement not posted but store under T-code CO1P that user have to clear manually. Therefore I have look at BAPI it