Need to find a specific word in a Text Field

I have a text field and I need to be able to perform a function if that field contains (not equals) the word "Excel". Textfield contains the word Excel
My sample is below
if (this.rawValue== "Excel") <---- instead of = I want something using wildcards before and after the word "Excel"
     Then do something
Else
     Do something else

Hi,
you can use a regular expression for this task.
if (this.rawValue.match(/\s+Excel\s+/g)) {
} else {

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?

  • I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically. Can some one out there help me?

    I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically.

    Update automatically under which circumstances, exactly?

  • How to copy paste a table structure from word document into Text Field [field format Rich Text]

    In our current implementation we have a Blank page with Text Field [field format Rich Text] on generated PDF Document.
    Once the PDF document is generated, user can copy paste content form any word/rtf document to into the Text Field.
    Pasted content retains all text formatting [Bold, Italic, Underline, Indentation] except the Table format. Text Field is removing table metadata from the content and converting it into plant text.
    Is there anyway to copy paste table structure as it is from word document into Text Field?

    Hi,
    I don't think you can! While you can paste formatted text into the rich text field, the table metadata means nothing to the textfield.
    Niall

  • Need help creating actionListener for an array of text fields

    I am working on a school project, so I am very new to Java. I have a program which is basically a unit converter. Each unit type has its own tab. I was able to dynamically create text fields in each tab and now I need to add actionListener to each of those text fields. Probelm is, the text fields are not really unique. I guess they're only unique within their tab. So now I am having difficulty referring to my text fields. If you look at my actionListener in the code below, I am trying to refer to it as unitTFs[0].getText() and that's not working. Please help. Thanks in advance.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class UnitConverter extends JPanel
    public UnitConverter()
    String[] lengthUnits = {"cm","m","inch","feet","yard","mile"};
    String[] areaUnits = {"m2","a","feet2","yd2","Acre","ha"};
    String[] massUnits = {"g","kg","ton","ounce","pound"};
    String[] volumeUnits = {"liter","m3","inch3","feet3","Gallon","Barrel"};
    String[] tempUnits = {"C","F"};
    ImageIcon lengthICN = new ImageIcon("java-swing-tutorial.JPG");
    ImageIcon areaICN = new ImageIcon("java-swing-tutorial.JPG");
    ImageIcon massICN = new ImageIcon("java-swing-tutorial.JPG");
    ImageIcon volumeICN = new ImageIcon("java-swing-tutorial.JPG");
    ImageIcon tempICN = new ImageIcon("java-swing-tutorial.JPG");
    JTabbedPane tabPaneJTP = new JTabbedPane();
    JPanel lengthPNL = tabContents(lengthUnits);
    tabPaneJTP.addTab("Length", lengthICN, lengthPNL);
    tabPaneJTP.setSelectedIndex(0);
    JPanel areaPNL = tabContents(areaUnits);
    tabPaneJTP.addTab("Area", areaICN, areaPNL);
    JPanel massPNL = tabContents(massUnits);
    tabPaneJTP.addTab("Mass", massICN, massPNL);
    JPanel volumePNL = tabContents(volumeUnits);
    tabPaneJTP.addTab("Volume", volumeICN, volumePNL);
    JPanel tempPNL = tabContents(tempUnits);
    tabPaneJTP.addTab("Temperature", tempICN, tempPNL);
    //Add the tabbed pane to this panel.
    setLayout(new GridLayout(1, 1));
    add(tabPaneJTP);
    protected JPanel tabContents(String[] units)
    JPanel tabPNL = new JPanel();
    JTextField[] unitTFs = new JTextField[units.length];
    JLabel[] unitLs = new JLabel[units.length];
    for (int i = 0; i < units.length; i++)
    unitTFs[i] = new JTextField("0");
    unitLs[i] = new JLabel(units);
    tabPNL.add(unitTFs[i]);
    tabPNL.add(unitLs[i]);
    tabPNL.setLayout(new GridLayout(units.length, 1));
    return tabPNL;
    private class CmHandler implements ActionListener
    public void actionPerformed(ActionEvent e)
    double cm, m;
    cm = Double.parseDouble(unitTFs[0].getText());
    public static void main(String[] args)
    JFrame frame = new JFrame("Unit Converter Demo");
    frame.getContentPane().add(new UnitConverter(), BorderLayout.CENTER);
    frame.setSize(500, 500);
    frame.setVisible(true);

    Variables only have scope in the method (or block) in which they are created. That means if you create a variable in one function, you can't use it in another.
    If you want to use a variable in two different functions, you have to make it a member variable.
    [Declaring Member Variables|http://java.sun.com/docs/books/tutorial/java/javaOO/variables.html]

  • 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

  • Need to find a specific phone number

    Hi, I now have my own verizon wireless account, but I used to be on my Uncle's plan. I need to find a number of a man that called me about 3 years ago.
    I know this sounds idiotic, is there anyway to get Verizon to give that to me, or do you know if they keep records that far back? (with uncle's permission).
    I really need this number, and would appreciate any help.
    Thank you.
    -KG

    Well if you don't have way to get the Phone Records i'd say it would be impossible but it doesn't hurt to ask C.S. you might try that Route Call and ask if there would be a possibility but i'd say they would only give this Info if there is a Definite Need Like contacting a Relative or friend but all you can do on this is call and Try..  Good Luck and here is the Number to C.S. 1-800-922-0204 b33

  • Plist strings to UILabel: formatting specific words in the text?

    Developers,
    I have a UILable populated by a plist string. I would like the UILabel to display text, with specific words in bold format.
    I have looked around for a solution to this problem, but I haven't found anything useful on the net.
    Is this possible?
    I have been thinking that this could be done by using a key (e.g. stars around a word *word1*) that identifies particular words within the plist string to be formatted. An if statement could then be used to filter through which words should be formatted, within each string. I'm not sure if this would work or how i would implement it, which is why i turn to you for your experience and advice.
    j
    Message was edited by: james_coleman01

    Hey James!
    james_coleman01 wrote:
    I would like the UILabel to display text, with specific words in bold format.
    Any single instance of UILabel can only have one font, one text color, etc. There's no way to draw one letter or word differently from any other.
    I have been thinking that this could be done by using a key (e.g. stars around a word *word1*) that identifies particular words within the plist string to be formatted. ...
    As always, you're on the right track, James. In fact if you extend your idea to include syntax for italics, underlines, superscripts, etc., then add font family, point size and text color, then add various paragraph styles, you'll be well on your way to inventing what's known as "rich text".
    So the web search keys you needed were "UILabel UITextView rich text". I think the two most common solutions to your requirement are: (1) If the text is static, put the words in separate labels; (2) The recommended, and most general solution: Use UIWebView in place of UILabel.
    No. 2 isn't as kinky as it might seem, even if you've never used HTML (the most widely known example of rich text). Here's a short blog that's probably enough to get you going: [Display Rich Text Using a UIWebView|http://iphoneincubator.com/blog/windows-views/display-rich-text-using -a-uiwebview]. The responses on that page include some good tips too.
    \- Ray

  • Add xml tag to specific words in a text frame

    Dear all,
    I'm pretty sure this can't be too much of a hassle, but after hours of experimenting, searching and reading I can't seem to look at it from the right angle. I'm trying to find a way to search for a specific word ('Figure', in my case) in a given text frame, and add a corresponding XML tag to it automatically. I've found plenty of information on how to apply it to a page item as a whole, but from there no approach seems to work. Seeing as I'm fairly new to InDesign scripting, any nudge in the right direction would be an immense help.
    Kind regards and thanks in advance,
    Julian

    Hi Julian,
    Is this you asking?
    var doc = app.activeDocument;
    app.findTextPreferences.findWhat = "figure";
    var found = doc.findText();
    for(var i =0;i<found.length;i++)
            doc.xmlElements[0].xmlElements.add({markupTag:"figure", xmlContent:found[i]});
    Regards,
    Chinna

  • Need help to add the words in a text file to an arraylist

    I am new to java and I really need some help for my project.I want to add the words of a text file to an arraylist. The text file consist of words and the following set of punctuation marks {, . ; : } and spaces.
    thanks in advance :-)

    I/O: [http://java.sun.com/docs/books/tutorial/essential/io/index.html]
    lists and other collections: [http://java.sun.com/docs/books/tutorial/collections/index.html]

  • Wrap a single word in a text field

    Hello everyone!
    I currently have a problem with text data that is displayed in a Flex text field <mx:Text>.
    It's a narrow textfield (100px wide) in a animated ad banner that displays content from a database. There are some words that are too long for the available space, so flash wraps some letters to the next line. I have attached a screenshot that shows the actual problem.
    The text is shown in a Java web-application as well, and since that Java app is displayed as a normale webpage, there is a lot more space for the text. I cannot put hyphens into the text because it would look weird in the normal web view.
    Is there a way to make automatic hyphenation happening when Flash wraps a single word?
    It would be perfect to get language-specific correct hyphenation, but a hyphen at the wrong spot is still better than no hyphen at all.
    Thanks for your time and help!

    I think your simplest bet would be to use mx:label and use the op
    tion truncateToFit="true". Also adjust the width so that the text appears prope
    rly. Hope this helps..!!

  • How to word wrap within text field

    I've created a form with a text field but when filling the form out, the words don't word wrap, but merely go in a single line across the text box field. 
    When can I format the text box to word wrap?
    tks

    I have set my text fields to multi line and the text wraps but it only starts about halfway down the text box.  Please help, this is getting frustrating...

  • How to change the text color of certain word in dynamic text field

    i know in html css can done by this <td style="red">You
    are now at <span style="yellow">home</span></td>
    .... the "home" word can change to another color .... any one who
    know this can done in flash , please give some advice or example

    look in the help file for 'setTextFormat', which can be
    applied on a whole
    text field or only part of it.
    "adreny" <[email protected]> wrote in
    message
    news:fb0hon$38q$[email protected]..
    >i know in html css can done by this <td
    style="red">You are now at <span
    > style="yellow">home</span></td> .... the
    "home" word can change to another
    > color .... any one who know this can done in flash ,
    please give some
    > advice or
    > example
    >
    >
    >

  • How to make words in a text field change color in play mode by clicking on them?

    I have a text field on a slide, wanting to change the color of certain words randomly by clicking on them in play mode. I dont know what word in what order will be mentioned by the audience, so I can not set a fixed order in advance.
    Any help is appreciated.
    Thanks a lot.

    create a slide with all the text boxes in place
    duplicate the slide as many times as you have text boxes you want to change colour
    on the second slide, change the colour of one of the text boxes as required
    on the first slide, select one of the text boxes
    open the inspector:     Inspector > Hyperlink >
               enable as hyperlink > link to slide > click slide button > select the correct slide from the drop down menu
    in play mode, clicking on the hyperlink will display the appropriate slide with that text changing colour
    repeate the process for each text box

  • 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

Maybe you are looking for