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?

Similar Messages

  • How to find a specific word (from a list) in a sentence located in a different table, and build a column that contains the name

    Hi all, 
    I have 2 tables:
    1) Lookup table- "Names"- which contains ID# and product description (~100 names that can change).
    2) Data table- "Data"- which contains a column with sentences and within lies also the description. In addition, there is a quantity column.
    Example:
    Names table-
    ID
    Name
    1 Glass
    2 Paper
    3 Alum'
    4 Metal for construction
    100 Hydro therapy products
    And Data table-
    Description
    Qty
    Someone went to use the machine. 1.80 cm, Alum', for the rest of the day
    6
    Metal for construction is the major component in our system
    7
    <gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="ba668f16-4de8-41d9-af39-d1b17422d6fe" id="ae5b76e8-6897-46c8-823b-86a382087f83">Kandoo</gs>, Delgado,
    Glass 17
    Greece needs more paper, 200 ft.
     45
    *there is no order where the lookup value can be found in the sentence*
    My purpose is to import the Data table while performing a calculation, that <gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="1941bde7-1595-40eb-9d64-c2e3b9fabdef" id="b60549fc-5b92-46ea-abc6-72cc8c4c093b">checks</gs>
    for each row what is the suitable lookup value and then add it to a new column "Name". 
    Meaning, this table should be the new data after import:
    <gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="f5d9da98-3ff6-4022-920d-8965a15730ee" id="580f945f-7822-4035-9b5b-542c74eff605">Description</gs>
    Qty                        
    Name
    Someone went to use the machine. 1.80 cm, Alum', for the rest of the day
    6 Alum'
    Metal for construction is the major component in our system
    7 Metal for construction
    <gs class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="365dd7f8-7ffc-4ef3-95bf-9bf03421c90d" id="c9ba8515-3dba-4a6b-929e-650510f70844">Kandoo</gs>, Delgado, Glass
    17 Glass
    Greece needs more Paper, 200 ft.
     45 Paper
    Appreciate all support! 
    I lost hope and I want to avoid macros as much as possible.
    Thanks!
    עמית

    Hi Amit,
    I updated the file. The solution uses the following query formula:
    let
    Source = Excel.CurrentWorkbook(){[Name="DataTbl"]}[Content],
    #"Added Custom" = Table.AddColumn(Source, "Custom", each IndexTbl),
    #"Expand Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Scope"}, {"Scope"}),
    #"Filtered Rows" = Table.SelectRows(#"Expand Custom", each Text.Contains([Description], [Scope])),
    #"Grouped Rows" = Table.Group(#"Filtered Rows", {"Topic", "Component Code", "Project", "Date", "TotalQty", "TotalQtyActual", "ID", "SOW #", " SOW#(lf)Rev", "Scope Driver", "Scope Source", "Scope Source #", "Cost Code", "Type", "Bdg", "System Code", "IMF Number", "IMF Description", "WG", "C or NC", "C/e", "LLE", "Dwg Ref", "Comments ", "Description", "Size", "Qty", "Unit", "Materials Cost/Unit ", "Sub-Total per Unit €", "Unit Rate ", "Total", "DIV Code", "SYS Code", "HelperForDynfilter"}, {{"Scope", each Text.Combine([Scope], " | "), type text}})
    in
    #"Grouped Rows"
    It is based on two queries. The first is the import from table of "IndexTbl", the second is the import of "DataTbl' which is then extended according to the expression above.
    Hope this helps.
    Gil

  • 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 a particular word in a file using java

    Program how to find a particular word in a file

    SirivaniG wrote:
    Program how to find a particular word in a fileOkay, I finished it. Now what?

  • 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

  • In e-mail, how can I highlight certain words or sentences?

    How would I highlight certain words or sentences in e-mail?

    Hi Bee
    Thanks for yoUr reply.  All you recommended I know how to do, what I am looking for is a like a yellow highlighter, to be able to highlight a word, paragraph,etc.  I thought there was one in an older v.OSX.

  • While printing from word appl. printer after each line puts in number of page,

    while printing from word appl. printer after each line puts in number of page, so I do not print 3 pages but 5 instead. What to do?

    What printer models is this intended for?  I assume it is aimed at the lower end inkjets, with the suggestion of loading 10-25 sheets of paper.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • 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?

  • Here's how to find the right word in a string

    I needed to find the rightmost word in a string. I didn't find a simple formula in these forums, but I now have one, so I wanted to share it. Hope you find it useful.
    Assuming that the string is in cell A1, the following will return the rightmost word in the string:
    RIGHT(A1,LEN(A1)-FIND("*",SUBSTITUTE(A1," ","*",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))

    I found the problem. Whatever character was being used in the substitution was parsed out by the forum parser. I replaced it with "œ" (option q on my keyboard).
    =RIGHT(A1,LEN(A1)-FIND("œ",SUBSTITUTE(A1," ","œ",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
    Still needs an error check for a single-word "sentence" and to remove the trailing period but it does seem to work. Pretty slick.
    Message was edited by: Badunit
    I see below that the problem was fixed by the OP.
    Message was edited by: Badunit

  • Find a specific word in a directory

    Hi Folks:
    I am trying to develop a apps, with the following functionality:
    To find for a specific word, like S010101, into a specific directory, saying something like: c:\Docs.
    And return, the number of ocurrences or, true if the string was found into a directory files or the name of the files wich include the string.....
    Can be possible with Oracle Forms or maybe with webtoolkit or with java and forms implementation?
    any ideas?
    Thanks a lot in advance
    Abdel Miranda
    Panama
    Edited by: aemsmeg on Jan 7, 2009 8:30 AM

    Hi Francois:
    Maybe I am trying to do something wrong, so let me give you a picture about my requirements and see if what I'm trying to do is on the rigth way.
    In my work, we have 4 environments: DEV, SYS, PRE and PROD. All of them has its own Schema and Objects, which are the same but they can have [and it is usual] different data stored.
    And, for every environment we have a migration directory with a tree like this:
    M:\\Apps\Request\S0001\DB\S0001_db.zip
    M:\\Apps\Request\S0002\DB\S0002_db.zip
    M:\\Apps\Request\S0003\DB\S0003_db.zip
    ................. and so far.
    Those zip files can have a sql files with a scripts which creates, modify, database objects and, the main issue, creates a customize user errors like: USR-xxxxx, VTM-xxxxx.
    As I wrote before, we have four environments, and I need to have track of which user errors codes are created and which one are available to use.
    By example, in DEV, the last user error code is USR-0005. If one of my developer need to generated the next user error code, he can select the max code where error type like USR. But maybe, another developer can generate the next user error code, in this case USR-0006. The developer team will not know where is the last error code generated, unless it find into the migration directory inside all of the zip files to see if exist in one of them, the insert for the next error code.
    I was thinking to develope a automatic ganeration form, where the developer, press a button. See the last error code and next error code related to a error type [USR, VTM].
    And then, press another button, select the migration directory [DEV, SYS or PRE] and find the string "USR-xxxxx" only in the qms_message.sql only in the _db.zip in the migration directory and all its sub directories.
    I am not sure If I am explain myself properly.
    Thanks a lot and any help, I will appreciated.
    Abdel Miranda
    Panama
    Edited by: aemsmeg on Jan 15, 2009 1:56 PM

  • 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 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?

Maybe you are looking for

  • Use Of "#EC CI_EXECSQL in ABAP with EXEC SQL. Statement giving Syntax Error

    Dear Gurus, I have encountered an issue while trying to remove warning for using Native SQL statement using pseudo comment "#EC CI_EXECSQL The thing is like this -- i have used follwing native sql command in abap. EXEC SQL.     CONNECT TO 'SURROUND_D

  • Populate a database from a pdf

    Hi, I'm trying to extract data from a pdf file. The pdf is actually release notes from another project. Another thing bugging me is that while the layout stays the same, the length of the text varies from one file to the other (it may event take more

  • Error 200140 and 200278 in Finite Retriggerable Encoder Triggered Sampling

    Hello, I have been using a rotary encoder to trigger a retriggerable sampling task. The encoder will give a pulse once per revolution and this will cause Labview to generate a finite pulse train which will be used to sample an analogue channel. The p

  • RMAN: Increment backup very slow

    Hi All, We have Datawarehouse database having size around 7TB. Increment backup performance is extremely poor it is taking approx 14hrs to complete the process. We have also enabled block change tracking but failed to meet target. Below mentioned DB

  • Permission conflict when sending mail

    Hi, I have a javabean that sends email, and it works fine when I use the ISP settings on my local machine. The problem occurs when I place my code on a webserver and another ISP. 1. How can I set username and password to the smtp mail? 2. Any suggest