Finding Last occurance of a word to gather key information

I am wondering how to find the last occurance of a word using coldfusion to gather the data i need. I am using some of the google maps XML code and the last occurance of distance gives the total distance which is what i need. How would I be able to find the last occurance and take the data from the code and place it in a template?

<DirectionsResponse>
<status>OK</status>

<route>
<summary>Hwy 7/Regional Road 7 E</summary>

<leg>

<step>
<travel_mode>DRIVING</travel_mode>

<start_location>
<lat>43.8334600</lat>
<lng>-79.4994300</lng>
</start_location>

<end_location>
<lat>43.8210000</lat>
<lng>-79.4994700</lng>
</end_location>

<polyline>
<points>cfpjGlffdNvBc@vDB|@G`\oFtMaAfNyAjARl@d@Xb@l@~Bj@|E</points>
<levels>B?????@????B</levels>
</polyline>

<duration>
<value>110</value>
<text>2 mins</text>
</duration>

<html_instructions>
Head <b>south</b> on <b>Basaltic Rd</b> toward <b>Jacob Keffer Pkwy</b>
</html_instructions>

<distance>
<value>1511</value>
<text>1.5 km</text>
</distance>
</step>

<step>
<travel_mode>DRIVING</travel_mode>

<start_location>
<lat>43.8210000</lat>
<lng>-79.4994700</lng>
</start_location>

<end_location>
<lat>43.8196300</lat>
<lng>-79.4989100</lng>
</end_location>

<polyline>
<points>gxmjGtffdNpGoB</points>
<levels>BB</levels>
</polyline>

<duration>
<value>36</value>
<text>1 min</text>
</duration>
<html_instructions>Turn <b>left</b> at <b>Planchet Rd</b></html_instructions>

<distance>
<value>158</value>
<text>0.2 km</text>
</distance>
</step>

<step>
<travel_mode>DRIVING</travel_mode>

<start_location>
<lat>43.8196300</lat>
<lng>-79.4989100</lng>
</start_location>

<end_location>
<lat>43.8231600</lat>
<lng>-79.4720400</lng>
</end_location>

<polyline>
<points>uomjGdcfdNyRg{AwEq\]wDoC}QQqBF{CVyAp@qBvAcBdDoB</points>
<levels>B????@??@?B</levels>
</polyline>

<duration>
<value>241</value>
<text>4 mins</text>
</duration>
<html_instructions>Turn <b>left</b> at <b>Langstaff Rd</b></html_instructions>

<distance>
<value>2333</value>
<text>2.3 km</text>
</distance>
</step>

<step>
<travel_mode>DRIVING</travel_mode>

<start_location>
<lat>43.8231600</lat>
<lng>-79.4720400</lng>
</start_location>

<end_location>
<lat>43.8738800</lat>
<lng>-79.2597800</lng>
</end_location>

<polyline>

<points>
wenjGf{`dN}UubAgH{WkAcFuAqHsBiPcCg^kAmL}LobAg@{CsAqE}@mBm@cAaGuHmBwCsAaDuAiFaFiZgBgMoA{KiA {MwAqUi@}MQiJG_GAs`@WeDg@uDai@{uDuLy{@iLi}@cJap@gCaPiFgUmAyGs`@wmCqJct@aQomA}@kFiCqRsB{M]i BOMkCaNmBaLi@uDDU]mCo@}DGAqCiRFK_BuKKE}Ism@WqAqAaEoDmI]uABO]}B
</points>

<levels>
B???@????@?????@?@???@?????@???????????@??????????????@?????B
</levels>
</polyline>

<duration>
<value>1425</value>
<text>24 mins</text>
</duration>
<html_instructions>Turn <b>left</b> at <b>Hwy 7/Regional Road 7 E</b></html_instructions>

<distance>
<value>18072</value>
<text>18.1 km</text>
</distance>
</step>

<step>
<travel_mode>DRIVING</travel_mode>

<start_location>
<lat>43.8738800</lat>
<lng>-79.2597800</lng>
</start_location>

<end_location>
<lat>43.8812800</lat>
<lng>-79.2615900</lng>
</end_location>

<polyline>
<points>wbxjGrlwbNgBXGN{GfA{`@vF</points>
<levels>B???B</levels>
</polyline>

<duration>
<value>93</value>
<text>2 mins</text>
</duration>

<html_instructions>
Turn <b>left</b> at <b>Main St N/ON-48 N</b> (signs for <b>Sutton</b>)
</html_instructions>

<distance>
<value>838</value>
<text>0.8 km</text>
</distance>
</step>

<step>
<travel_mode>DRIVING</travel_mode>

<start_location>
<lat>43.8812800</lat>
<lng>-79.2615900</lng>
</start_location>

<end_location>
<lat>43.8829000</lat>
<lng>-79.2506100</lng>
</end_location>

<polyline>
<points>_qyjG|wwbN}A_L]iEy@eD{Es\Eu@DcBlAuH</points>
<levels>B???@??B</levels>
</polyline>

<duration>
<value>104</value>
<text>2 mins</text>
</duration>
<html_instructions>Take the 3rd <b>right</b> onto <b>Parkway Ave</b></html_instructions>

<distance>
<value>924</value>
<text>0.9 km</text>
</distance>
</step>

<step>
<travel_mode>DRIVING</travel_mode>

<start_location>
<lat>43.8829000</lat>
<lng>-79.2506100</lng>
</start_location>

<end_location>
<lat>43.8834200</lat>
<lng>-79.2503400</lng>
</end_location>

<polyline>
<points>c{yjGhsubNgBu@</points>
<levels>BB</levels>
</polyline>

<duration>
<value>27</value>
<text>1 min</text>
</duration>

<html_instructions>
Turn <b>left</b> at <b>Sir Constantine Dr</b><div style="font-size:0.9em">Destination will be on the right</div>
</html_instructions>

<distance>
<value>62</value>
<text>62 m</text>
</distance>
</step>

<duration>
<value>2036</value>
<text>34 mins</text>
</duration>

<distance>
<value>23898</value>
<text>23.9 km</text>
</distance>

<start_location>
<lat>43.8334600</lat>
<lng>-79.4994300</lng>
</start_location>

<end_location>
<lat>43.8834200</lat>
<lng>-79.2503400</lng>
</end_location>
<start_address>Vaughan, ON, Canada</start_address>
<end_address>Markham, ON, Canada</end_address>
</leg>
<copyrights>Map data ©2011 Google</copyrights>

<overview_polyline>

<points>
cfpjGlffdNvBc@vDB|@G`\oFtMaApMyA|@Db@Ll@d@Xb@l@~Bj@|EpGoByRg{AwEq\]wDoC}QQqBF{CVyAp@qBvAcB dDoB}UubAgH{WkAcFuAqHsBiPcCg^kAmL}LobAg@{CsAqE}@mBm@cAaGuHmBwCsAaDuAiFaFiZgBgMuB_SkAiPy@cO _@yJQiJI{RDoNEgEWeDij@q{DuLy{@iLi}@cJap@gCaPiFgUmAyGs`@wmCqJct@aQomA}@kFiCqRsB{M]iBOMkCaNm BaLi@uDDU]mCo@}DGAqCiRFK_BuKKE}Ism@WqAqAaEoDmI]uABO]}BgBXGN{GfA{`@vF}A_L]iEy@eD{Es\Eu@DcBl AuHgBu@
</points>

<levels>
B?????@???@?@A????@??@?A???@????@?????@?@???@?????@???@??????????????????????@?????@???@?? ?????B
</levels>
</overview_polyline>

<bounds>

<southwest>
<lat>43.8196300</lat>
<lng>-79.4994700</lng>
</southwest>

<northeast>
<lat>43.8834200</lat>
<lng>-79.2503400</lng>
</northeast>
</bounds>
</route>
</DirectionsResponse>
Here is the code, the last <distance> tag contains the total distance of the trip which is the only thing I am interested in.

Similar Messages

  • Find the first occurance of a word

    I have a script which finds and counts ALL occurances of a word.
    I need the script to find the FIRST instance of a word only.
    Can any one please advise how to modify the script to find the first instance of the word?
    Script as follows:
    var numWords = this.getPageNumWords(0);
    for (var i=0; i<numWords; i++)
    var ckWord = this.getPageNthWord(0,i);
    if ( ckWord == "MATERIAL")
    /*Script will go here based on finding the first instance of the word "MATERIAL"*/
    I have tried var CKWord = this.getPageNthWord(0,0); but console reports back is UNDEFINED?

    Thanks for your help.  Script now returns the first occurance of the word "MATERIAL".
    I know have to add to the script to find the SECOND OCCURANCE of the word "ISSUED".
    Can you please advise how I would code the script for this, ie would this have something to do with the break command?
    var numWords = this.getPageNumWords(0);
    for (var i=0; i<numWords; i++)
    var ckWord = this.getPageNthWord(0,i);
    if ( ckWord == "ISSUED")
    var coord = this.mouseX;
    var annot = this.addAnnot({
    page: 0,
    type: "Stamp",
    name: "AppStamp",
    rect: [coord+1000, 2300, 30, 2820],
    rotate: 90,
    AP: "#C94cHAFFa42U1gTH5Tug5C" }); 
    /*break; how can this be modified to break for the second occurance of the word "ISSUED"?*/

  • How to find the ocuurence of a word from LIST A in LIST B in a text file?

    Hey if you look at the text file there is LIST A and LIST B.. i need to find the ocuurence of a word from LIST A in LIST B. Eg: if my output is (1,3)
    then first word from LIST A occurs in 3 places in LIST B.
    Can you please get the sample code to do this process.
    Please let me know..
    My text file looks like this below :
    phrases.txt
    LIST A
    aamsz
    abaffiliate
    aboard casino
    above computer
    above pop
    above violat
    LIST B
    http://209.153.231.131
    HTTP/1.0 200 OK
    Server: Microsoft-IIS/5.0
    Date: Mon, 02 Feb 2004 11:53:26 GMT
    IISExport: This web site was exported using IIS Export v2.2
    IISExport: This web site was exported using IIS Export v2.2
    Content-Length: 274
    Content-Type: text/html
    Set-Cookie: ASPSESSIONIDSSDBBBAR=OOGFKOJBMKMDCGPIHPADALHB; path=/
    aboard casino
    Cache-control: private
    abaffiliate
    above computer

    The key difference is that Vector is synchronized whilst ArrayList is not. Synchronized means that the classes methods can safely be accessed by different threads and as your application will not be multithreaded then the ArrayList is possibly the better option.
    To store Strings in an ArrayList, you first need to declare the ArrayList object something like this;
    ArrayList<String> listAList = new ArrayList<String>();and you would obviously do something similar for the ArrayList that will hold the Strings that should belong to List B.
    The first thing to note is that you can use the new (well new in version 1.5 anyway) generics techniques to specify the type of the object the ArrayList will hold; Strings in this case.
    To add a value into the ArrayList once you have read it from the file and decided if it belongs in the List A or List B ArrayList, all you need to do is call the add() method of the ArrayList something like this;
    // Assume that you read the line from the file into a variable called temp;
    listAList.add(temp);To compare the two lists, the easiest option would be to iterate through one ArrayList and ceheck to see if the values you recover from it are duplicated in the other ArrayList. Luckilly, ArrayList has another method that helps here, it is called contains();
    Assuming that you have two ArrayList(s), one called listAList that holds the Strings that belong to List A and another called listBList that holds the Strings that belong to ListB, you could do something like this to check for duplicates;
    for(String element : listAList) {
        if(listBList.contains(element)) {
            System.out.println("Found a match");
    }Hope that helps.

  • How to find last inserted record in the table.

    Version: Oracle 10g
    I have a table called "Manufacture" and 3 columns as mfno,itemname,quantity.
    How to find last inserted record in the table "Manufacture".
    As i come to know that Rowid is not result perfect results. Please provide your inputs.

    user13416294 wrote:
    Version: Oracle 10gThat is not a version. That is a product name. A version is 10.1.0.2 or 10.2.0.4, etc.
    I have a table called "Manufacture" and 3 columns as mfno,itemname,quantity.
    How to find last inserted record in the table "Manufacture".Not possible as your data model does not cater for it. That simple.
    If there is a need to determine some order or associate some time to an entity, then that should be part of the data model - and a relationship, or one or more attributes are needed to represent that information. Thus your data model in this case is unable to meet your requirements.
    If the requirements are valid, fix the data model. In other words - your question has nothing to do with Oracle and nothing to do with rowid, rowscn or other pseudo columns in Oracle. It is a pure data modeling issue. Nothing more.

  • Java Regex - Find Last Match Using Pattern and Matcher

    I'd like to write some regex which would allow me to grab the last occurance of match based on a specified list of items. So for:
    Pattern languageRegex = Pattern.compile("(len|end)");
    And a string of:
    "00| 0lend|"
    I want it to extract "end". However, I'd grab "len" using the above regex.
    If it was
    "00| 0lenend|"
    I'd grab "end" which is right.
    What regex would allow me to grab "end" rather than "len" from:
    "00| 0lend|"
    Thanks for your help.

    user3940995 wrote:
    I have a list of 3 letter codes that I need to check for in a field. The list is finite but about 100 or so items:
    len, end, ren, onm, enl, etc.
    However, the field I'm checking in has some other data in it which can bleed into the code but the code will always be at the end.
    An example would be "000 0rend"
    From this I'd want to extract "end". If there is a better way to do this than using regex then I'd be happy to use that, but as I have to process millions of items I'm keen to not loop trying to find a match so I was hoping there would be a regex solution.
    Your regex would work for that particular example. I think if I modify it to be
    Pattern.compile("len(?!\\D)|end(?!\\D)|enl(?!\\D)"); (which would then be extended for all the list items)
    Then I seem to pick up the last occurance as I'd like to.
    Thank you for your help!Doesn't sound like you want to use regexp. I would instead build a character graph/tree with my commands in reversed order. I would then search each line backwards and check if it matches something in my tree.

  • How to find last DML operation in oracle ADF

    how to find last DML operation in oracle ADF
    Please help me
    Thanks
    Damby

    In the base EntityIml class, just override doDML() method as I said.
    (see http://docs.oracle.com/cd/E16162_01/web.1112/e16182/appendix_mostcommon.htm
    "Methods for Creating Your Own Layer of Framework Base Classes")
    So, put a some flag in the session.
    You should not call doDML() method in backing bean, it will be called by framework.
    In the backing bean, you only have to get that information from the session, as follows:
    String last_dml_op = (String)ADFContext.getCurrent().getSessionScope().get("last_dml_op");And voila...

  • To find last run date of custom concurrent program in oracle apps

    Hello Exports,
    Can you pls tell me how to find last run date of custom concurrent program in oracle apps.( thr Backend query )
    Thanks in advance,
    Edited by: 981527 on Mar 7, 2013 3:01 AM

    try the below:
    select fcp.user_concurrent_program_name
    ,fcr.request_date
    ,fu.user_name
    ,fcr.actual_start_date
    ,fcr.actual_completion_date
    ,fcr.phase_code
    ,fcr.status_code
    ,fcr.argument1
    ,fcr.argument2
    ,fcr.argument3
    from fnd_concurrent_programs_vl fcp
    ,fnd_concurrent_requests fcr
    ,fnd_user fu
    where fcp.user_concurrent_program_name like 'Payroll Run'
    and fcp.concurrent_program_id = fcr.concurrent_program_id
    and fcr.requested_by = fu.user_id
    order by fcr.actual_completion_date desc

  • To find last updated date in sql developer for a procedure or a function

    hi
    how to to find last updated date in sql developer for a procedure or a function.
    i m using sql developer version in 1.2

    I think you are in the wrong forum...
    Anyway you can try
    select * from
    all_objects o
    where o.object_type in ('FUNCTION','PROCEDURE');
    you have there the created date, last DDL and timestamp

  • Using CS_BOM_EXPL_MAT_V2 how to find last children of material in the bom.

    Hi,
    I want to find last children of a material.I am using FM CS_BOM_EXPL_MAT_V2. Although STPOX internal table as STUFE for level but we can't get all the last child of material directly.
    For example material A as child A1 and A2 this sub divided into A1- A11, A12 and A2 - A21 , A22 and again A21 -A211,A212 and A22 - A221,A222
    so the last children are A11,A12,A211,A212,A221,A222. So if we use max of STUFE it will omit A11 and A12.Do i need to program a custom logic to get last child using Stufe and WEGXX or is there any other method available to get Last Children of the Material or is there any other Function module to get the Last child of the material.
    Thanks in Advance.

    You will have to write your own custom logic after calling the function module.  In my case, it is easy, because the lowest level materials will always be raw materials(material type ZROH) as opposed to a semi-finished material(material type HALB).  Your's may be different.
    REgards,
    Rich Heilman

  • I can't  find my opponents In my words free app on my ipad

    I can't find my opponents in my words free app on my ipad2

    Try deleting and reinstalling the app if you haven't already.

  • Can't find last import from iPhone! Noticed as I imported I had that view where there was only one project symbol, not all my projects showing by date, but even so pictures were imported. It took the time to do them, so where

    Can't find last import from iPhone!
    Noticed as I imported I had that view where there was only one project symbol, not all my projects showing by date, but even so pictures were imported. It took the time to do them, so where aare they? I have closed and restarted to get back fll view of all dated projects, but nothing can be found from today...

    have i posted it right...??  no response from apple guys...

  • How to find last login date of a sql login?

    i want to disable the SQL Logins which are not logged in last 15 days. (I schedule a job every night to check and disable)
    For this 
    i want to find  last login date of all sql logins in an instance if the login didn't log in with in 15 days i want to disable them.
    In SYS.SYSLOGINS table we can see all the logins and 'isntname' tells us if it is SQL login or windows login. 
    but where to find the last login date of SQL log in ?
    Can any one help me?

    Hi HYDBA,
    If you use SQL Server 2005 or later, you can only get the current logon data using
    DMV likes:
    select
    max
    (login_time)as
    last_login_time, login_name
    from
    sys.dm_exec_sessions
    group
    by login_name;
    Related to your question there are two options:
    One is logon trigger,
    which is used to get current login time and login name comparing with the data from
    sys.dm_exec_sessions. If the current login time comparing with last login time is larger than 15 days, then prevent the current login.   
    Another one is to schedule a job, which is used to disable logon who’s current login time
    comparing with last login time is larger than 15 days.
    Hope it’s helpful for you.
    Regards, Amber zhang

  • How to find last executed query

    Hello,
    I want to find the last executed query in the Oracle database.
    Can anybody help me, how can I find last fired query.
    I am using following query for it, but it gives me the same query as in the result.
    SELECT SQL_TEXT FROM V$SQL
    WHERE ADDRESS = (SELECT SQL_ADDRESS
    FROM V$SESSION
    WHERE AUDSID = USERENV('SESSIONID'))
    Please help me.Thanks.

    Hi,
    select sa.sql_text,ss.username
    from v$session ss, v$sqlarea sa
    where sa.hash_value = ss.prev_hash_value
    SQL> /
    SQL_TEXT
    USERNAME
    DELETE FROM T
    HR
    GRANT SELECT ON T TO
    HR
    SELECT COUNT(*) FROM HR.T
    SCOTT
    SQL_TEXT
    USERNAME
    select sa.sql_text,ss.username from v$session ss, v$sqlarea sa where sa.hash_val
    ue = ss.prev_hash_value
    SYSregards
    Taj
    Message was edited by:
    Mohammad Taj

  • How to find last accessed/updated tables and the query text?

    I am using :
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.4.0 - Production
    How to find last accessed/updated tables and the query text?
    Regards
    LEE1212

    Check DBA_TBALES view there you find one date column that indicate last update
    One option is as follows:
    (1) Turn the auditing on: AUDIT_TRAIL = true in init.ora
    (2) Restart the instance if its running.
    (3) Audit the table:
         AUDIT INSERT,SELECT,DELETE,UPDATE on TableName
         by ACCESS WHENEVER SUCCESSFUL
    (4) Get the desired information using :
         SELECT OBJ_NAME,ACTION_NAME ,to_char(timestamp,'dd/mm/yyyy , HH:MM:SS')
         from sys.dba_audit_object.
    Cheer,
    Virag Sharma
    http://virag.sharma.googlepages.com/
    http://viragsharma.blogspot.com/
    Message was edited by:
    virag_sh

  • How to find last executed query on database and or schema.

    hi,
    how to find last executed query on database and or schema.
    yours sincerely

    Sessionwise if you wanna see means use v$session.. Because it will show execution time also so you can analyze it easily and get sql based on SID and serial number ..
    Try :
    select * from v$session;
    Regards..

Maybe you are looking for

  • Need help to Install MI

    Hi Experts, I am installing MI 7.0 on oracle 10g and Win-2003,i got stucked in the Create database Statistics phase. so below is the log i pasted. INFO 2007-08-13 16:22:25 Creating file C:\Program Files\sapinst_instdir\NW04S\SYSTEM\ORA\CENTRAL\AS\brc

  • How do you add a multiple entries at once to a drop-down list box?

    I'm making a form for students to fill out and I want them to be able to pick from about 200 different courses. In the Field/List Items place, it would appear that you can only enter one item one at a time. I did this for 56 faculty,which took too mu

  • File Adapter Format Issue:.csv target

    Hello When i am trying to write information from DB to a file as a CSV format it is always writing into xml format, though it is named with .csv extension. When you want to write the File as html target i need to do a html encoding but how to do it i

  • Failed trying to read text....

    My Systems working like this, client open page with browser,and see some text at the page... Back end Working : RMIServer try to read some file with read code like this : fileRead = new FileInputStream("UIA.txt"); inputServer = new BufferedReader(new

  • Export flv. QT 7.4

    I used to be able to choose from imovie and Quicktime pro Export to .flv. With the upgrade to QT 7.4 this option has dissapeared. Any reason why? Anyone know how to get this back. If not I have just added an entire extra step of having to save out my