Search and provide the output of the same name in a file

Hi,
My requirement is a bit strange. But I think it is a good problem.
I have a file which looks like this. I have provided a part of it here:
house     
tom:  agent, person, untidy
jack: ordered, tidy, tiled
roof
tom: agent, person, criminal, axe, blade, guillotine
jack: death, dead, no head, headless
chair
tom: person, medicine, drugs
jack: no pain, relief, joy, safe
fan
tom: person, asleep, snore, dream, alarm
jack: awake, morning, day My requirement is this:
I will get the input in my code in the form of "myArrayStrings2.get(r)" where r is a random number. [Actually this input is obtained from some other file and I have taken the file into an arraylist and got the random input to this code like this.]. The inputs are: "house","roof", "chair", etc. Corresponding to each input we have some tom and jack.
This is a large file and there are lots of other inputs that I have not mentioned but is of the same form.
I would like to get separately for a specific input like "house" a random tom and a random jack corresponding to the input "house" or maybe "fan" etc.
[Since this input is generated randomly I do not know what my input is going to be. and also the toms will have to be a random tom specific to the input obtained randomly.]
So, for example, again: My input is ,say, fan. My output has to be for tom: dream and for jack as awake. [Just a random tom and jack for every fan]
I hope I have made it clear enough....
Thanks

I am trying like this :
[house,tom:, agent,, person,, untidy,jack:, ordered,, tidy,, tiled,roof,tom:, agent,, person,,.....]
I see that house is at position 1 and tom at 2. I can easily get the index of the tom after house.
Also, If I can get the index of jack then by subtracting I can get the number of elements in tom. Then by get method in arraylist I can easily get the elements in Tom.
Similarly for jack also.
But this is easy for the first case. But is giving me errors for later cases.
This is because it is holding the position of the first jack. How to bypass this and dynamically allocate the jack index??If this is done then I think the problem will be solved.
int r = generator.nextInt(4)+2 ;  //random
String name3 = myArrayStrings2.get(r1);//get random input like house . r1 is a random number.
                if(myArrayStrings1.contains(name3)){
                      int x = myArrayStrings1.indexOf("jack:") ;
                      int y = (myArrayStrings1.indexOf(name3)+1) ;
                      int a = y - x;
                      System.out.println("a: "+a);
                     String Tom1 = myArrayStrings1.get((myArrayStrings1.indexOf(name3)+r));
                     System.out.println("Tom for: "+myArrayStrings2.get(r1)+ " is "+Tom1);
               }

Similar Messages

  • I just published my Muse site on Adobe, and now when i do a search and get a return on the search, it repeats the site name several times. is it in the page properties?

    I just published my Muse site on Adobe, and now when i do a search and get a return on the search, it repeats the site name several times. is it in the page properties?

    By search you are referring to Google search ?? or you are using any search module in your site and the keywords shows same topic multiple times on page ?
    Please elaborate more, provide site url.
    Regarding using keywords, description etc, you can add that to your page using page properties > metadata section.
    http://muse.adobe.com/strategies-for-seo.html
    Thanks,
    Sanjit

  • How to search and delete an email from the mailbox

    hi,
    have a hybrid scenario, exchange 2013 and office 365
    what command should I use to search and delete an email from the organization mailbox i.e. I do not want that email to be in any users inbox.
    I have tried this command but it does not work, it says search-mailbox is not recognized as the name of the command let.
    Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Download this file"' -DeleteContent
    kindly assist.
    Kind Regards, Khuzema R.

    Hi Khuzema
    This can be accomplished by search-mailbox command
    First you need to create a new role group
    To Create –  New-RoleGroup “Mailbox Import-Export Management” -Roles “Mailbox Import Export”
    Then add the user to the group
    To Add user – Add-RoleGroupMember “Mailbox Import-Export Management” -Member Administrator
    Search the mailbox
    get-mailbox -ResultSize unlimited -IgnoreDefaultScope | search-mailbox -SearchQuery ‘Subject:”virus infected”’ -LogOnly -TargetMailbox administrator -TargetFolder filter -LogLevel Full
    Now we need to run the below command to search the infected emails and delete all of them in the whole organization
    get-mailbox -ResultSize unlimited -IgnoreDefaultScope | search-mailbox -SearchQuery ‘Subject:”virus infected”’ -TargetMailbox administrator -TargetFolder filter -deletecontent -LogLevel Full
    Also you can do a message tracking with the subject and delete them
    Get-ExchangeServer | where {$_.isHubTransportServer -eq $true -or $_.isMailboxServer -eq $true} | Get-MessageTrackingLog -Messagesubject “Virus Infected” | Select-Object Timestamp,ServerHostname,ClientHostname,Source,EventId,Recipients
    | Sort-Object -Property Timestamp
    I have written a blog with regards to the same. You can always refer this which might mostly  help you in your scenario
    http://exchangequery.com/2014/10/16/steps-to-delete-circulated-suspicious-emails-with-search-mailbox/
    Thanks 
    Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you Check out my latest blog posts on http://exchangequery.com Thanks Sathish
    (MVP)

  • Problem displaying the output in the same view

    hi Gurus,
    I have developed an web dynrpo application and have three views, in the first view I am having an input field from which I am calling a BAPI by giving that input field value as input to the BAPI.
    Now is it possible to display the output also retrived from the BAPI on the same view.
    Thanks and regards
    kris

    hi LM,
    Thanks for your fast response.
    I think I was not clear in explaining my problem.
    I have a view in which I have an input field which is the input to the BAPI, now on entering the value in the input field I have a submit button, on clicking the BAPI should be executed and also the the output should be displayed on the same view.
    Now regarding the mapping both the input and output are in the same context, would that a problem.
    And also after getting the output from the BAPI I have to do some validations based on the output from the BAPI and get some message printed on the view.
    Please help me in this issue.
    Thanks and regards
    kris

  • I am using Adobe Pro 11 and on opening a pdf I am getting error 'Insufficient Data for an Image'. Please help and provide a workaround if the solution not there.

    Hi all,
    I am using Adobe Pro 11 and on opening a pdf I am getting error 'Insufficient Data for an Image'. Please help and provide a workaround if the solution not there.
    I have already set the preferences to for page view to low zoom settings, and page fit view settings, but it never opens the pdf. Please check and provide a solution asap.
    Thanks in advance!

    Most of the documents have sensitive info on them.  I will have to do some looking for some that i can share, but will get something to upload (dropbox) as soon as I can.
    Thanks for you help.

  • I want to add hyperlink in the illustrator file and want the output in the PDF

    I want to add hyperlinks in the illustrator file and want the output in the PDF.
    I tried to add the multiple hyperlinks on the text and images in the illustrator by using the attribute panel but the links are not working in the published PDF.
    Is there is any other method to create a hyperlink in the illustrator?
    Can anybody help me out in this
    Thanks

    Interesting, Carlos.
    There's another method by JET: Re: hyperlinks in Ai

  • To get the output  in the chart for a single selection

    Hi all,
    I used a query to get the output of the table, and for the same query i have  created a view to get the result in the chart.
    to get the output of the table for  a particular region i have created an input field and added value help to it. When i selected one particular region, i will be getting the data, in the table. But when i select a particular row in the table i need to get the data of that particular row only in the chart. (which i am getting)
    But when i select multiple regions at a time, then i am facing the issue. I get result of multiple regions data(at a time two rows are displayed in the chart) in the chart. where in i want to get data only for one region (only one row needs to get selected at a time) to get the result.
    Can any one throw a light of what needs to be done here.
    Thanks,
    Rani

    Hi Rani,
    I am not sure if I understand your question exactly, but it sounds like you need to set the selection mode for your table to "Single". If you do that the user will only have the possibility of selecting one row at a time in the table; they will not be able to select multiple rows.
    You make that setting in the Configure Element panel for the table.
    I hope this suggestions helps.
    Margaret

  • Make the output of the BI report rtf file some fields non editable

    Hello All,
    I want to make some fields in the output of the BI report as editable and some non editable. Any output format is fine (PDF, RTF or HTML) Please let me know if anyone knows how to do it.
    Thanks in advance..
    Anu

    You can add RTF to active allowed output type list (provided that your reporting system supports it) by going to CustomerReportExtensions.xml file and adding the following node right after ParameterTypes node:
    <ActiveReportOutputTypes configChildKey="key">
    <ActiveReportOutputType key="RTF" value="RTF" extension=".rtf"/>
    </ActiveReportOutputTypes>

  • Selection-screen in the output of the program

    Hi,
    I want to print the selection criteria ( or Values )  in the output of the program  on the RIGHT HAND SIDE OF THE HEADER. I am doing code through ALV and I want to include the respective code in 'TOP_OF_PAGE'
    If there are no values in the selection screen fields, then I DO NOT Print them. Start the values with the texts, such as 'Material', 'Plant', 'MRP Controller' etc. For single values, print the values separated by commas, For a range of values, print the values separated by '-', For the exclusion of single values, print 'EX' before the values.
    Thanks in Advance.

    To get the parameter list, use [RS_REFRESH_FROM_SELECTOPTIONS|https://forums.sdn.sap.com/search.jspa?objID=c42&q=RS_REFRESH_FROM_SELECTOPTIONS], the rest is basic Abap.
    Regards,
    Raymond

  • How to execute the output of the below query automatically

    Hi All,
    I want to execute the output of the below query automatically, instead of manually copying it and execute.
    select 'alter database ['+name+'] set recovery simple' from master.sys.databases where database_id > 4 and state_desc = 'online'
    Please provide me a script to do this.
    ThanK
    Kate

    EXEC sp_MSforeachdb N'ALTER DATABASE [?] SET recovery simple';--- This will set the recovery model for all the system database.The query provided by Vikash16, meets my requirement. Thank you.

  • I have configured PDF Genrataor in LiveCycle 2.5. When I place a folder (which has doc file in it) in the IN folder..I expect the OUT to contain same folder (with pdf file in it), But it does not happen.

    I have configured PDF Genrataor in LiveCycle 2.5. I have configured my watchedfolder endpoints.
    When I place a folder (which has doc file in it) in the IN folder..I expect the OUT to contain same folder (with pdf file in it), But it does not happen. What I see in in the OUT folder I see a pdf file with the foldername and pdf extension....
    Can anyone suggest.......

    Why do we have to install 2 add ins for something that should be built in? Please add this to the next version or an update to this one even. We should see the full path of a bookmark when we search for it. Show Parent Folder alone isn't enough if you have sub folders, so I installed Go Parent Folder as well in case of sub folders.

  • Is it Possible to display the output of the ALV list as POP-UP

    Hi Experts,
                     Is it Possible to display the output of the ALV list as POP-UP, if yes then provide some ideas on it.
    thanking in advance,
    Samad.

    Hi samad, it is possible to display alv list as pop-up by using the FM " REUSE_ALV_POPUP_TO_SELECT"
    try this sample code
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
          EXPORTING
       I_TITLE                       =  P1_TITLE
           I_SELECTION                   = 'X'
           I_ZEBRA                       = 'X'
      I_CHECKBOX_FIELDNAME          =
      I_LINEMARK_FIELDNAME          =
      I_SCROLL_TO_SEL_LINE          = 'X'
            I_TABNAME                     = 'T_VBAP'
           I_STRUCTURE_NAME              =  'T_VBAP'
           IT_FIELDCAT                   =  T_FCAT2
           I_CALLBACK_PROGRAM            = 'ZTEST_ALV_POPUP'
       IMPORTING
           ES_SELFIELD                   = I_SELFIELD
           E_EXIT                        = W_EXIT
          TABLES
            T_OUTTAB                      = T_VBAP.
    i think it will solve your problem
    Regards,
    Vijay

  • How to send the output of the 1st BPEL process as a input to 2nd BPEL Proce

    Hi,
    I am working on OBPM 11G and my requirement is like below,
    From Mediator we need to call two different BPEL process. 1st one is Synchronous one and second one will be a one way interface. We need to call a java call out from Mediator and then give the output to the first BPEL process. The output from the first BPEL process has to be given to the second BPEL process with a filter condition.
    However we have achieved to call Java callout as well as call to two different BPEL process but facing issues in sending the output of the first BPEL process as a part of input to the second BPEL process.
    Any help on this would be appreciated.
    Bibhu

    Hi,
    Why do you need the third step, if the second step is a Numeric Limit Test step type, you can setup the limits of this step for your required limits of 11V and 12V. Your result is returned from your VI to Step.Results.Numeric which will be evaluated in the Status Expression giving you a Pass / Fail status.
    Look at the example TestStand\examples\demo\..\Computer Motherboard Test\computer.seq
    But to answer your reoriginal question, some additional information is required.
    What are your inputs and outputs assigned to in TestStand, do you use the Step properties, Locals, FileGlobals?
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How to hide the specified rows in the output of the report?

    Hello all,
        I have a requirement where i have to hide some of the lines (<b>initial 6 lines</b> that is <b>6 rows</b>) in the output of the report.
    How would I go about doing this?
    Thanks for you time.

    Hello Sai,
    I believe this is query output ( e.g., )
    Country   Sales
    India        $100
    USA        $200
    Germany  $300
    You want to hide the line Germany  $300
    Case 1:
        If you can change the query, Filter on Country and exclude Germany
    Case 2:
        If you can not change the query, use url appending and filter out Germany
    Check webapi reference for the exact commands
    Case 3:
        Only if you are using the NW2004s front-end, Report designer will be available for you. In this, you can delete the rows that you do not want and publish in web.
    Case 1 and 2 solutions are available in older versions of front-end as well.
    Regards,
    Sheik Bilal

  • LabVIEW 6.1 If For Loop count terminal is zero then value going through the loop is not passed on to the output of the loop

    Hello, one of our customers just encountered an execution error in a vi running under LabVIEW 6.1, which doesn't exist under LabVIEW 5.1 or 6.01. I have a simple vi that has two encapsulated For Loops. Two string arrays go in, one goes out of the outer loop. Inside the outer loop the first array is indexed. The string which results from this indexing is compared with all other strings from the second string array in the inner loop. If it matches one of the strings of the second array, it is not outputted, otherwise this string goes through the inner For Loop to the output of the inner loop and from there to the output of the outer loop. The count
    terminal of the outer/inner loop is connected to the Array Size of the first/second string array. If the second array is empty, that means that the element in test from the first arry cannot match anything from the second array, so the element in test is send to the output of the inner loop and from there to the output of the outer loop. This works fine in LabVIEW 5.1 and 6.01, but NOT in LabVIEW 6.1. In LabVIEW 6.1 the inner loop is never executed if the count value is zero (which is correct), but the data line running through the loop is not executed either, which is different to what LabVIEW 5.1 and 6.01 do. There, the input string is sent to the output of the inner loop correctly even if the loop counter is zero. The solution is easy - I just have to connect the output of the outer loop to the data line BEFORE it enters the inner loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is supposed to be a feature, but it brings some incompatibility in programming between the
    different LabVIEW versions.
    Best regards,
    Gabsi

    Hi,
    When a for-loop runs zero times, all outputs are 'undefined' (and should
    be).
    Besides, how would LV know what the output of a not executed routine should
    be?
    It might be handled differently in LV5 and LV6, which is unfortunate. In
    both cases, the result is undefined.
    It's not a bug. It's just something that should be avoided in any LV
    version.
    > The solution is easy - I just have to connect the
    > output of the outer loop to the data line BEFORE it enters the inner
    > loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is
    In some cases this does the trick. But if the data is changed in the inner
    loop, this will effect the results if the N is not zero.
    Technically, I think the output in this construction is also 'undefined'.
    But LV handles this as expected / desired.
    Another solution is to use a shift register. If N is zero, the input is
    directly passed through to the output.
    Regards,
    Wiebe.
    "Gabs" wrote in message
    news:[email protected]...
    > LabVIEW 6.1 If For Loop count terminal is zero then value going
    > through the loop is not passed on to the output of the loop
    >
    > Hello, one of our customers just encountered an execution error in a
    > vi running under LabVIEW 6.1, which doesn't exist under LabVIEW 5.1 or
    > 6.01. I have a simple vi that has two encapsulated For Loops. Two
    > string arrays go in, one goes out of the outer loop. Inside the outer
    > loop the first array is indexed. The string which results from this
    > indexing is compared with all other strings from the second string
    > array in the inner loop. If it matches one of the strings of the
    > second array, it is not outputted, otherwise this string goes through
    > the inner For Loop to the output of the inner loop and from there to
    > the output of the outer loop. The count terminal of the outer/inner
    > loop is connected to the Array Size of the first/second string array.
    > If the second array is empty, that means that the element in test from
    > the first arry cannot match anything from the second array, so the
    > element in test is send to the output of the inner loop and from there
    > to the output of the outer loop. This works fine in LabVIEW 5.1 and
    > 6.01, but NOT in LabVIEW 6.1. In LabVIEW 6.1 the inner loop is never
    > executed if the count value is zero (which is correct), but the data
    > line running through the loop is not executed either, which is
    > different to what LabVIEW 5.1 and 6.01 do. There, the input string is
    > sent to the output of the inner loop correctly even if the loop
    > counter is zero. The solution is easy - I just have to connect the
    > output of the outer loop to the data line BEFORE it enters the inner
    > loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is
    > supposed to be a feature, but it brings some incompatibility in
    > programming between the different LabVIEW versions.
    > Best regards,
    > Gabsi

  • [OLAP DML] display on screen the output while the program is running

    Hi,
    I'm running a script in AWM that is quite long, and I've placed some few 'show' so that I know what the program is doing, but it won't show on the screen the outputs until the program ends. I guess it writes all the outputs in a kind of buffer and release the content of the buffer at the end of the program.
    How could I have it to release this buffer continuously?
    Thanks

    i think the relational analogy would be an anonymous pl/sql block executing a list of commands while outputting a list of useful dbms_output.put_line log statements:
    Just as with SHOW and olap worksheet cmd line, you cant see the running dbms_output log while the pl/sql program is running... you need to wait for it to complete before you can see the log.
    You can write to a file and close/exit the file each time or you can write to log table and commit each time but i guess, some such heavy lifting is needed if you want to track the long running process mid-way.
    NOTE: For regular operations like dbms_cube.build load/forecast/allocate process/steps, you can always run queries against CUBE_BUILD_LOG etc mid-way. But if it's pure olap dml actions being performed then no neat pre-built handle to check things mid-way exists.

Maybe you are looking for

  • Applying a rating to multiple images

    Hi all, this would be a rather embarassing question had I not looked for an answer for so long. I can't stand the way Julieanne Kost edits picks and rejects. I don't know any pros who edit that way personally, and it seems so ineficient; except maybe

  • Share my library (InD Cs4) with a Cs3 user.

    I have the problem that I want to share my Cs4 library (win) with a Cs3 user (mac). Files are fine to share if I export them as .inx But I can't find a way to export my library. Is there any smart solution? Thank you in advance

  • IPhone won't update from 4.3.1 to 5.0.1

    I have been trying to update my roommates iPhone 3GS software from 4.3.1 to 5.0.1 on iTunes. When I try to click update, a message pops up saying "There was a problem downloading the software for the iPhone. The netwoek connection could not be establ

  • Applying transitions in the timeline

    Hi, I have recently created a dvd of videos and stills but when viewed on a tv the stills are pixelated. I originally created the sequences in premiere and rendered them out as mp4, to use in encore. However, when the the movie is played the still im

  • Change Settings for Command + F

    Hey guys I was just wondering if there was anyway for me to able to change the highlight color of "Command+F". Everytime I use it I can barely see the word that it highlights on the page because it is such a light color. If anyone knows how you could