How to find a specific char in fileinputstream?

Hi
I've opened a fileinputstream for a text file.
I need to read through it char by char to eof in order to find occurances of some ascii characters e.g. "," or "@" etc
      int eofii =0;
      try
        FR = new FileReader("UnusualTextFile.txt");
        while(eoFii != -1)
           eofii = FR.read();       
           if (eofii != -1)
             bytesRead++;
             out.println((char) eofii);  //this prints the whole text file, one char at a time...
                              //      Say, I would like to find the number of comma's in the text file ,
                              //          I tried several variations, none of which work...
             if (((char) eofii).compareTo (",")) out.println("It is a comma!");
             if (((char) eofii) == ",") out.println("It is a comma!");
        }

Is it possible to compare the locale-independ, ascii value?
This file has some weird characters not on my keyboard?

Similar Messages

  • How to find a specific word in sentence in each line?

    How to find a specific word in sentence in each line and output will show start from the beginning from specific word plus with small description from each sentence?
    For example: I need to find a "+Wednesday+" and "+Thursday+" word in each sentence by line by line from "myfile.txt".
    Go ballet class next Wednesday.
    On the Wednesday is going to swim class.
    We have a meeting on Thursday at Panda's.
    Then it will show the output:
    Wednesday : ballet class
    Wednesday : swim class
    Thursday: meeting at Panda's
    I am going to figure out in Java console to read from a file for specific word from each line and how to make it output in correct way. I know already to make input/file codes.

    I got it and understand much better. Thank you very much. There is a problem with it because I knew how to make
    a specific word in sentence but how I should make Output for specific word and some words from sentence.
    For example:
    Input:
    +"On Thursday go to ballet class"+
    +"Swim class on Friday one time a month at 2 p.m."+
    I used the codes for that:
    class FindSchedule{
         String firstline = "On Thursday go to ballet class ";
         String secondline = "Swim class on Friday one time a month ";
         FindSchedule(){
              System.out.println(firstline + findTheIndex("Thursday", firstline));
              System.out.println(secondline + findTheIndex("Friday", secondline));
         public int findTheIndex(String word, String sentence){
              int index;
              index = sentence.indexOf(word);
              return index;
         public static void main (String[] args){
              new FindSchedule();
    }The output will be:
    Thursday: ballet class
    Friday: 14:00 swim class one time a week
    Notice that time is changing in output complete different from input.
    I need to find out how to extract some words from each sentence for output. Do you know how to do it?

  • Hi, I don't know how to find a specific security patch to apply to my Oracle database version to fix a vulnerability

    Hi, I don't know how to find a specific security patch to apply to my Oracle database version 11.2.0.2.0 (on windows server 2003 32 bits) to fix the following vulnerability:
    Risk: High
    Application: oracle_tnslsnr
    Port: 1521
    Protocol: tcp
    Synopsis:
    It is possible to register with a remote Oracle TNS listener.
    Description:
    The remote Oracle TNS listener allows service registration from a remote host. An attacker can exploit this issue to divert data from a
    legitimate database server or client to an attacker-specified system.
    Successful exploits will allow the attacker to manipulate database instances, potentially facilitating man-in-the-middle, sessionhijacking,
    or denial of service attacks on a legitimate database server.
    Solution:
    Apply the work-around in Oracle's advisory.
    Thank you for your help

    2835604 wrote:
    Hi, I don't know how to find a specific security patch to apply to my Oracle database version 11.2.0.2.0 (on windows server 2003 32 bits) to fix the following vulnerability:
    Risk: High
    Application: oracle_tnslsnr
    Port: 1521
    Protocol: tcp
    Synopsis:
    It is possible to register with a remote Oracle TNS listener.
    Description:
    The remote Oracle TNS listener allows service registration from a remote host. An attacker can exploit this issue to divert data from a
    legitimate database server or client to an attacker-specified system.
    Successful exploits will allow the attacker to manipulate database instances, potentially facilitating man-in-the-middle, sessionhijacking,
    or denial of service attacks on a legitimate database server.
    Solution:
    Apply the work-around in Oracle's advisory.
    Thank you for your help
    that sounds like the "tns poison" vulnerability.  CVE 2012-1675 - Oracle Security Alert CVE-2012-1675
    See MOS note 134083.1  and 1453883.1

  • How to find a specific song?

    I am looking for the song "To Sir With Love" by Lulu with the group The Mindbenders. My problem is that apparently there are two versions? And when I listen to the samples I can't tell if it's has the lyrics I'm looking for. I want the version which is sung in the movie which includes the line Those awkward years... Does anyone know how to find a specific version of a song? Thank you in advance for your help.

    Search the iTunes Store for "to sir, with love"
    One of the songs will contain in the title (from the Columbia movie.....
    No guarantee but I would guess that's the one you are looking for.
    http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=193322123&id=19332 1271&s=143441

  • How to find the specific build of  Oracle9i Jdeveloper??

    Hi All
    I am quite new to OAF, Please help How to find the specific build of Oracle9i Jdeveloper that corresponds to the specific OA Framework release installed in the runtime environment. I would like to know two things here.. how to find 1)what is the patchset installed in environment 2) which Jdeveloper ARU corresponds to that.
    Thanks in Advance !
    Savitha

    Pl see MOS Doc 416708.1 (How to find the correct version of JDeveloper to use with eBusiness Suite 11i or Release 12.x)
    HTH
    Srini

  • How to find a specific activity done by a particular user in the database

    How to find who (a specific user) does what (activities) on a specific date/time to certain Objects in a database instance. If similar posting and/or resources are available, please advise.
    Thanks.

    I have got the same problem. My operation steps is below:
    1. create one dictory
    mkdir /usr/local/dbs
    chown oracle:oinstall /usr/local/dbs
    2. modify the paramter
    alter system set utl_file_dir='/usr/local/dbs' scope=spfile;
    3. restart database
    4. create the logmnr file:
    BEGIN
    dbms_logmnr_d.build(
    dictionary_filename => 'logminer_dict.dat',
    dictionary_location => '/usr/local/dbs');
    END;
    5. add the online redo log file:
    execute dbms_logmnr.add_logfile(options =>dbms_logmnr.new,logfilename =>'/u01/app/oracle/oradata/orcl/redo01.log');
    execute dbms_logmnr.add_logfile(options =>dbms_logmnr.addfile,logfilename =>'/u01/app/oracle/oradata/orcl/redo02.log');
    execute dbms_logmnr.add_logfile(options =>dbms_logmnr.addfile,logfilename =>'/u01/app/oracle/oradata/orcl/redo03.log');
    6. start logmnr
    BEGIN
    dbms_logmnr.start_logmnr(
    dictfilename => '/usr/local/dbs/logminer_dict.dat');
    END;
    7. check the result
    select sql_redo FROM v$logmnr_contents;
    I got error message at the step:
    ORA-01306:dbms_logmnr.start_logmnr() must be invoked before selecting from v$logmnr_contents
    Could anyone help about this?

  • How to find a specific text(string) in a list (100) programs

    Dear All,
    Wish tou a very happy new year 2009!!!
    please let me know how we can find a specific word(eg: "barrel") in a list of programs/reports/bdc/user exits/field exits/function modules.
    Thanks in advance.
    Kumar.

    hi kumar,
    open EWK1 transaction and search for the word or string according to your requirement.
    Cheers
    Gautham

  • How to find the specifed user-exit

    Hi, experts. i am first time to do enchancement. can anyone tell me how to find specifed user-exit. for example, how to find MV45AFZZ?  Also, what i should pay attention to when doing enhancment works? thanks.

    Hi Jrockman,
    There are many things associated to user exit.
    a) Tcode- CMOD.    here you can find
    b)  USER-EXIT triggering points ->
    Go to se93 and give the tcode to find the main program associated to it.
    Go to se38 and give the main program.
    Find the package associated to it.Go to->Object Directory Entry.
    Go to smod transaction.
    Press f4.
    Press Information System Button.
    Give the Project(Dev Class).
    Press enter.
    Find the enhancements associated
    c) Check the code posted by me ,to get the list of User exits and Badi for a particular tcode in the link mentioned below.
    Re: User Exit for IW22 - to populate custom fields
    d) few useful links to understand User exits.
    http://www.sapdevelopment.co.uk/enhance/enhancehome.htm
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sappoint.com/abap/userexit.pdf
    ABAP Enhancements and Modifications - General
    https://www.sdn.sap.com/irj/sdn/developerareas/abap?rid=/webcontent/uuid/2342e1f3-0b01-0010-a186-fdd404884050
    Menu Exit
    http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/menu-exits-72696#
    Screen Exit
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    Hope it helps.
    Manish

  • How to find out which chars should be taken into an aggregate?

    Hi specialists,
    after I read some hints and how-tos about how to determine which InfoProvider/Query might profit from an aggregate (using the bi-statistics: db-time > 30% AND aggregation-factor > 10), I'm now facing the question:
    "Which characteristics need to be part of the aggregate and which can be left out ?".
    The answer to this question is certainly very dependant on the usage-behaviour of the infoprovider/query-consumers (=the users). So some kind of statistic about that would be quite helpful - but that's exactly what I'm missing.
    So - is there some kind of statistic I didn't discover yet?
    What's your strategy when you face the above problem?
    Asking the users (probably dozends) which chars they use is imho not an effective way.
    And doing that by "try and error" (e.g. generating several aggregates, and checking which is hit most) seems not the philosopher's stone either.
    I'm really looking forward for your comments!

    Hi Shikha Goel,
    thanks for you quick reply.
    Unfortunately I fear that it won't bring me forward :/.
    It depends uopn how you want your query to be ,and which will be more used one and what you want
    to be displayed .. (Chanracteristics ) ..
    Sorry, but that's exactly what I'm asking for. I (=the BW-Administrator) don't know how the (end-)users navigate the query and how exactly they use ist. I do not know which chars (of the available) are mostly used and which are used never/seldomly and might be droped from the aggregate. That's exactly the problem I have. And I cannot ask a dozen end-user about that (besides the point that some user's won't understand what I'm after...).
    Re: Query for functioning of Aggregate
    Please correct me if I'm wrong but: Isn't the use of the aggregate dependant on the navigation of the end-users? If the query e.g. has 10 chars and the aggregate has only 5 of them, then this does not constraining mean that the aggregate is missed generally. If only the 5 aggregate-chars (at a maximum) are used, than this aggregate would be a very good one. My question now is: How can I find out, which chars are mainly used/needed by the users?
    The link gives the hint that RSRT can be used to find a aggregate-proposal. That's certainly right - BUT: Only for the initial drill-down of a query. Everything what happens after the initial opening of the query is dependant on the users navigation-behaviour (<-- which I'd like to find in some statistics ).
    Hope I could make my point understandable.

  • How to find a specific function's description?

    Hi,
    I'm now looking at xperf stack trace, I would like to know the description of a specific function. For example, I don't know what does RtlUserThreadStart() function do. How to find such information. I tried to search the function name on MSDN, but nothing
    came up.
    thank you!
    Ah_Chao|| MCSE,VCP,EMCSAe

    could anyone show me some lights on this?
    thanks in advanced!
    Ah_Chao|| MCSE,VCP,EMCSAe

  • How to find a specific APP

    How do you find a specific free App once you sign in the Apple Store?

    The term Apple Store refers specifically to the physical Apple Stores located in various cities in countries around the world, the Apple online store at www.store.apple.com and the Apple telestore at 1-800-MY-APPLE. The Apple Store does not sell internet downloadable software apps or games. It sells a limited stock of boxed software.
    Apple sells apps & games through the Mac App Store accessed through an app on an Intel-based Macintosh computer running OS X Snow Leopard 10.6.8 or newer.
    Apple sells apps & games for iOS devices; iPhones, iPads and iPods Touch through the iTunes App Store which can be access through the iTunes app on a Mac or PC or the App Store app on an iOS device.
    Please use this exact terminology when seeking help so that we know exactly which store you are trying to use.
    Are you using the Mac App Store app referred to by seventy one in his post? Or are you looking for apps somewhere else?

  • HT4085 how do find a specific author

    How do I find a specific Author.

    If you mean in the ibookstore in the iBooks app then you can type in the author's name in the search box at the top right of the Featured, Top Charts or Categories tabs - or you can just select the author (if they have any ibooks in the ibookstore) in the Browse tab

  • How to find a specific field name for the sapscript?

    Hi all,
    I have to print out the ship-to party in a sales quotation, but I can't find out which field should I use in the sapscript, how to find out?
    I tried to retrieve VBCO2-KUNWE, VBPAPO-KUNNR, VBPAV-KUNNR, but nothing returns.
    Thanks.

    Hi ,
    Can you check
    Table VBPA with PARVW = 'WE' and VBELN and POSNR.
    VBPA-KUNNR  -Ship to Party.
    Lanka

  • How to find my specific user exit

    hi friends,
    in the transaction vl06O , we have different screens under different tabs,
    in the screen under shipment tab, there are two fields,
    incoterm
    productcode
    i should change the values appearing in these fileds only for specific data,
    the data to the incoterm field is brough from likp table,
    i felt that, i shpuld be using a user exit  for this,
    can any one plz suggest  me which  user exit  to user  or how  do i
    find the correct user exit  for this  using break points, i found out that,
    the field incoterm is being called from
    a screen 2000 in
    SAPMV50A program.
    did any one face this problem earlier.
    thank you.

    Hi,
    Use this code to find user exits for specific transaction. You can create a tool program with this..
    REPORT z_find_userexit NO STANDARD PAGE HEADING.
    TABLES : 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
    DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
    DATA : field1(30).
    DATA : v_devclass LIKE tadir-devclass.
    *& 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 main program
    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.
          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 = enlfdir-area.
            MOVE : tadir-devclass TO v_devclass.
          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.
        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.
        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.
    Take the user to SMOD for the Exit that was selected.
    AT LINE-SELECTION.
      GET CURSOR FIELD field1.
      CHECK field1(4) EQ 'JTAB'.
      SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
      CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    Enjoy SAP.
    Pankaj Singh.

  • How to find a specific time moment in Timeline?

    Hi, this is a simple question I don't think I can find an answer for :-) Let's assume I need to find 4:54 moment in my clip, how can I do that in iMovie 10?

    Unfortunately, you can't.
    Matt

Maybe you are looking for

  • TS1363 what if you can not see the iphone in the devices?

    I have tried everything to try to get the iphone to connect but windows will not recognize it even as a mass storage device.

  • Can I store my iPhoto library on an external hard drive?

    My iPhoto library has become very large and I would like to tranfer it over to my hard drive. Can I copy my iPhoto library over to the drive and then delete it from my system hard disk without loosing my photos? And, when I import photos, where will

  • File path control-how to avoid the user to change the path string

    Hi all, I'm using "File path control" to chose file name. I don't want the user to write the path in the control directly (by typing) but only to choose the file via the button on the right. I can implement this behaviour with path indicator and butt

  • Count of Column

    I'm using Derby 10.5 via Command Interpreter I stucked at the count of column I need to know the command for getting number of columns used in a table .

  • NI-FBUS Communications Manager 4.0.1 Error

    I have dual LAN connection on my notebook as enclosed in the first picture. The NI-FBUS Interface Configuration Utility recognises the connection to the HSE linking device without any errors, see second picture. Ping to the address is OK, but the NI-