How to calculate the number of vowels from a txt file. Pls give me a hand!!

Guys! How do i calculate the number of vowels from a txt file? I have to create a program to count the number of words, sentence, and vowels. So far I had managed to count the number of words. Now I need help on counting sentence and vowels! Pls give me a hand guys!

I first have to read from the file not the string.I
know how to read from a file. Now the problem ishow
to compare a character from a txt file!You fail to understand, that you have read the data
from the file into a string. Now loop over all
characters in the string. Forget about the file.
KajOr forget the scanners just as others have told you. Just read the file character by character using a FileReader.
Kaj

Similar Messages

  • How to calculate the number of sent/received emails of a certain domain

    Thank you for what you have helped me with!
    How to calculate the number of sent/received emails of a certain domain in a certain period? It is Messaging Server 5.2, Directory Server 4.2. Is there a log option for this?
    Thank you.

    Not sure where you find, "LOG_MESSSAGE_ADD". I don't actually find this option in the documentation.
    The domains that mails are coming from and being sent to are certainly logged in the normal mail.log, so why mess with additional logging options? If you're talking about "LOG_CONNECTION", I actually see no additional data that is useful to you.
    If you decide to change the option.dat, you do indeed need to
    imsimta cnbuild (note, it's not cnrebuild)
    imsimta restart
    If I were facing the same issue, I'd be looking at the log parsing perl script, and simply modifying it to do what I wanted.

  • How to calculate the number of operations in Undo/Redo stack?

    How to calculate the number of operations in Undo/Redo stack?
    I tried to override UndoManager.pushUndo method and increment "operationsCounter" there, but pushUndo is called each time I make a change in text.
    Another idea was to override EditManager.finalizeDo and use "operationsCounter" there, but finalizeDo is private...
    Do you have any idea?

    Hi Richard,
    Thanks for the reply. I suggested that existed the more simple way to implement this

  • Count the number of lines in a txt file

    I need to count the number of lines in a txt file, but I can't do it using readLine(). This is because the txt file is double spaced. readLine() returns null even if it is not the end of the file. thanks for the help

    I need to count the number of lines in a txt file,
    but I can't do it using readLine(). Then just compare each single byte or char to the newline (code 10).
    This is because the txt file is double spaced. readLine() returns
    null even if it is not the end of the file.Errm what? What do you mean by "double spaced"? Method readLine() should only return null if there's nothing more to read.

  • How to calculate the number of days worked for a given period

    I need to calculate the number of days worked by contractor employees for a time period to be entered by a user. I am building a query on an infoset which contains employee information including contract start date and contract end date for the employee.
    Ideally I'd like the user to enter the time period which should be reported on e.g. 01.08.2009 to 31.08.2009
    The report should then identify all the contractor employees which were working during this period and to work out how many days they worked during this period. Obviously the contract start and end dates could fall both inside and outside the reporting period.
    Can this be done and if so, do you have any suggestions as to how to do it?
    Thanks.

    hi
    So here you will first have to load the master data table employee in one internal table and read this table with the variables entries.
    Your code in the reporting exit should look like that.
    bye
    data : wa_employee type /bi0/pemployee.
    When 'ZDATE1'
    if i_step = 2.
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZDATE2'.
    clear l_s_range.
    clear wa_employee
    1- select the entries from table employees
    select single employee dateto datefrom
    from /bi0/pemployee
    into corresponding fields of wa_employee
    where dateto le loc_var_range-low
    and datefrom ge loc_var_range-high.
    if sy-subrc eq 0.
    CALL FUNCTION 'FIMA_DAYS_BETWEEN_TWO_DATES'
       EXPORTING
           i_datum_von  = wa_employee-datefrom
           i_kz_ult_von = 'X'
           i_datum_bis  = wa_employee-dateto
           i_kz_ult_bis = 'X'
           i_szbmeth    = '1'
       IMPORTING
          e_tage       = no_days.
           l_s_range-low  = no_days.
           l_s_range-sign = 'I'.
           l_s_range-opt  = 'EQ'.
          APPEND l_s_range TO e_t_range.
              ENDIF.
            ENDIF.
    endloop.
    ENDIF.
    Boujema

  • How to calculate the number of user connections in a report?

    Hi,
    I would like to have a report which automatically calculate the number of connections per user.
    Thanks for your answer.
    Regards

    Hi,
    What do you mean by number of connections? Do you mean how many times each user has run a specific report?
    Thanks

  • How to calculate the number of months between two string as yyyymm

    Dear all,
    I have two month string like yyyymm e.g. 201003 -- 201105. Now I want to calculate the number of months bertween these two month string? How can I do that? Thanks.

    888099 wrote:
    Hi,
    Hope this will help :
         public static void main(String[] args) {
              Calendar cal1 = new GregorianCalendar(2010, 02, 01);
              Calendar cal2 = new GregorianCalendar(2011, 04, 01);
              int years = cal1.get(Calendar.YEAR) - cal2.get(Calendar.YEAR);
              int months = cal1.get(Calendar.MONTH) - cal2.get(Calendar.MONTH);
              System.out.println("number of months : "+Math.abs(years*12 + months));
         }Or with only Strings :
         public static void main(String[] args) {
              String s1 = "201002";
              String s2 = "201104";
              int years = Integer.valueOf(s1.substring(0,4)) - Integer.valueOf(s2.substring(0,4));
              int months = Integer.valueOf(s1.substring(4)) - Integer.valueOf(s2.substring(4));
              System.out.println("number of month : "+Math.abs(years*12 + months));
         }Edited by: 888099 on 28 sept. 2011 05:49Full code solutions will not help the OP, he will be back here with a different Date question. Posters here try to nudge the OP to figure out the solution himself.

  • How to calculate the number of days until your next birthday. Only using current month, day and birth month and day.

    I'm trying to calculate the number of days until your next birthday. Only using current month, day and birth month and day. I can get close but i'm way off. When i enter in the next day, the amount of days is supposed to be 364. This is where I am having problems. I know my code is way off. I just need some guidance please!
    Attachments:
    D5.7_1.vi ‏8 KB

    I just had a little fun with the Time Record...
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    D5.7_1_BD.png ‏19 KB

  • Help with how to count the number of tokens from the first line

    Hi
    I want to count the number of tokens from the first line of text, from my incoming file and print it out.
    For example i have 12 tokens in the first line, so i want it to print out the number 12
    my code is below
    thanks
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.util.StringTokenizer.*;
    import java.sql.*;
    public class Data {
         public static void main(String[] args) {
                        String token = null;          
                        String currentToken = "";
                        Hashtable hh = new Hashtable();     
              try {
                   Vector v2 = new Vector(100);
                   Vector v = new Vector(100);
                   FileReader file = new FileReader("words.txt");
                   BufferedReader buff = new BufferedReader(file);
                   String line = buff.readLine();
                   StringTokenizer s = null;
                   boolean eof = false;
                   while  (!eof){
                        s = new StringTokenizer(line.trim(),",",true);
                        boolean lastToken = true;
                   while (s.hasMoreTokens()) {
                              token = s.nextToken();
                                  if (lastToken){
                                   if (token.equals(",")) {
                                        v.add("");
                                               lastToken = false;
                                      if (! token.equals(",")) {
                                   v.add(token);
                                  else { if (currentToken.equals(",")) {
                                        v.add("");
                                  currentToken = token;
                        if (token.equals(",")) {
                               v.add("");
                   line = buff.readLine();
                        if (line == null){     
                             eof = true;}
                   buff.close();
              }catch (FileNotFoundException fe) {     
                        System.out.println("Error - - " + fe.toString());
              }catch (NumberFormatException ne) {
                        System.out.println("Error - - " + ne.toString());
              } catch (IOException e) {
                   System.out.println("Error - - " + e.toString());
    }     2.

    I can print out the amount of tokens from each line,
    But i only want the first line to be counted, And i
    also do not want the delimeters to be counted.
    could you please give me some ideas?
    Thanks
    try
       BufferedReader br = new BufferedReader(new FileReader("item.kr"));
       while((str=br.readLine())!= null)
          itemslist.add(str);
    catch(IOException ioe)
       System.out.println("Exception Occurred!!!");
    }This snippet gets one Line from the item.kr file.
    Then i would count (By useing a diffrent String Tokenizer) to count only this line!!!

  • How to calculate the number of months....

    HI all
    can any body give the FM name which calculates the number of months between any two dates that are inputted
    thanks in advance

    Try this in ur source code of FM.....include the import and Export...as given
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(BEGDA) LIKE  PA0001-BEGDA
    *"     REFERENCE(ENDDA) LIKE  PA0001-ENDDA
    *"  EXPORTING
    *"     REFERENCE(DIFF_MONTHS) TYPE  I
    *"  EXCEPTIONS
    *"      ENDDA_GRTR
      DATA : SMONTH TYPE I,
             EMONTH TYPE I,
             SDATE TYPE I,
             EDATE TYPE I,
             SYEAR TYPE I,
             EYEAR TYPE I,
             MONTHSTOBEADDED TYPE I,
             YRDIFF TYPE I,
             DIFF TYPE I.
    Calculating the months to be added
      SMONTH = BEGDA+4(2).
      EMONTH = ENDDA+4(2).
    Finding the difference in years
      SYEAR = BEGDA+0(4).
      EYEAR  = ENDDA+0(4).
      IF SYEAR <> EYEAR .
        SYEAR = SYEAR + 1.
        DIFF =  ( 12 - SMONTH ) + 1.
        YRDIFF  = EYEAR - SYEAR.
        IF YRDIFF > 0 .
          DIFF = DIFF + ( YRDIFF * 12 ).
        ENDIF.
        DIFF = DIFF + EMONTH.
      ELSE.
        DIFF = ( EMONTH - SMONTH ) + 1.
      ENDIF.
    DIFF_MONTHS = DIFF.
    ENDFUNCTION.

  • How to find the number of data items in a file written with ArryToFile function?

    I have written an array of number in 2 column groups to a file using the LabWindows/CVI function ArrayToFile...Now if I want to read the file with FileToArray Function then how do I know the number of items in the file. during the write time I know how many array items to write. but suppose I want the file to read at some later time then How to find the number of items in the file,So that I can read the exact number and present it. Thanks to all
    If you are young work to Learn, not to earn.
    Solved!
    Go to Solution.

    What about:
    OpenFile ( your file );
    cnt = 0;
    while ((br = ReadLine ( ... )) != -2) {
    if (br == -1) {
    // I/O error: handle it!
    break;
    cnt++;
    CloseFile ( ... );
    There are some ways to improve performance of this code, but if you are not reading thousands of lines it's quite fast.
    After this part you can dimension the array to pass to FileToArray... unless you want to read it yourself since you already have it open!
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to calculate the number of events that happened per clock hour.

    My example case has a list of patients that were discharged from a hospital yesterday.  The patients are in a field caled "Account number".
    The field "Discharge Date" lets me select the date.  The field "Discharge TIme" shows me the time each patient was discharged.
    Example:  0715, 0830,1005, 1010, 1025, 1435, etc.   I need to run the report to know how many patients were discharged per each clock hour.  How many were discharged from 0000 to 0100, 0100 - 0200, 0200 - 0300, etc.
    Acct #     Disch Time
    P12121     0715 
    P23233     0731
    P34343     0812
    P32333     1015
    From research I am assuming I need to capture just the first two numbers that represent the hour and discard the minutes.
    I would like to see the results in a similar format to this.
    Hour     #of Patients
    07-08     2
    08-09     1
    09-10     1
    22-23     x
    23-00     x

    Jamie,
    I attemped to create the formula and got an error message.
    Also, Please explain in a little more detail how I do the following:
    "create a group on this new field, you can then right click on your patient field and choose Insert Summary > Count and add this to the group level.

  • How to calculate the number of records in Multiprovider

    Hi Experts
    I have created a report based on the multiprovider (Consist of Cube and ODS)
    I need count the number of records inside the multiprovider, how can i do it in the reporting level
    Regards
    Santosh

    Hi,
    You can use calculated key figure with replacement path variable.
    Follow This:
    1) From the context menu of the Key Figure directory, choose New Calculated Key Figure.
    2) From the context menu for the Formula Variable, choose New Variable.
    3) Choose the Processing type as Replacement Path.
    4) In the next screen, select the Characteristic Info Object based on which the number of documents is to be displayed in the report (For example: Document Number / Order Number).
    5) Choose Next.
    In the Replace Variable with drop down box, choose Attribute Value.
    In the Attribute drop down, select Characteristic Reference (Constant 1).
    6)Choose Next.
    On the Save Variable page, an overview of the settings made for the variable will be displayed.
    Confirm the entries and Choose Finish.
    7) If the Formula variable is directly assigned to the Calculated Key Figure, a warning Calculated Key Figure is not defined correctly will be displayed while executing the Query.
    8) Properties of Calculated Key Figure dialog box, assign a Technical name for the CKF.
    9) set the Time of Calculation to After Aggregation.
    Hope this will help you.
    Cheers,
    DK
    Edited by: Debasish Khaitan on May 14, 2009 1:03 PM

  • How to limit the number of items from RSS using XSLT

    Hello,
    I am using plsql to read contents from RSS, basically a simple RSS reader.
    I would like to somehow want the feature to restrict the number of items in the RSS feed, say I would like to display only the first 5 items.
    How could I achieve this?
    Any help is highly appreciable.
    Thanks in advance.
    Regards

    Hi,
    According your post, I know you would like to set the item display limit in Status List web part.
    In the web part, the number of items to display is based on the view which you selected when configuring the web part. The default view for status list is status list view.
    However, I am not able to limit the items’ display number of the status list view. After changing the items limit, the list item displayed would not match the number specified by Item Limit. Thus, it is not possible to limit the number
    of items in the Status list web part.
    It could be a potential issue in SharePoint 2010.
    We will log this issue to our suggestion box. As after the submission, we may not have any time guarantee when the fix may be released, but it may come out on next cumulative update.
    Appreciate your time and efforts.
    Thanks.
    Tracy Cai
    TechNet Community Support

  • How to calculate the number of times an user has accesed a BEx report

    Hi Experts,
    We have number of reports in our BW portal and users logon to the portal and run the reports.
    How do we count the number of times each user has logged in and ran each report.
    Kindly advice.
    Thanks,
    Sai

    Hi Sai:
    I think you can use BI statistics information, which could provide you more detail information.
    You can follow the document
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/90080703-4331-2a10-cd98-9c1e95acdea0
    Regards,
    Louis Lu

Maybe you are looking for

  • Adobe Download Assistant gives error after finishing downloading, why?

    I have downloaded the trial version of CS5.5 Master Collection twice. But when the download is completed Adobe Download Assistant gives Error and cannot install the software. I go check in the download folder and there's nothing there. My laptop haas

  • How to enable a disabled iPhone?

    I have an iPhone 3G and a passcode lock was entered 10 times incorrectly. This wiped all the information off the device and also disabled it. I would like to know how to reenable a disabled iPhone 3G.

  • Can't import "unreadable" but Picassa ok?

    Hi guys Been using my old Sony DSC P200 for some years ago and always imported no drama's. Tried the latest batch and they all come up "Unreadable - unrecognised file format or invalid data". Done a search on here and from another thread have tried i

  • HT204053 I need to update my mac as the version is 10.6.8 and it doesn't have icloud

    I need to update my MAC that is currently running Mac OS X version 10.6.8 in order to access iCloud.  Any ideas?

  • SD Card Corruption Issue?

    Hi there, I believe there is a cross-platform problem with Android causing the SD card to become corrupted, specifically with photo/video files. I'm wondering if anyone has any solid answers to this problem (a Google search of the title of this threa