Finding the data between two different substrings in a string
Hey guys-
This is probably really easy for someone...I can't figure it out with CF. I've searched a bunch but haven't found exactly what I'm looking for.
I'm searching a HTML document with Coldfusion and need to pull some data from it. Just as a quick example, somewhere in the HTML document there might be some code that looks like (this is obviously super simplified):
<tr><td>Grand Total: </td></tr><tr><td>$1000.00</td> </tr>
I need to do a couple of things. 1) I need to capture the $1000.00 (this amount is dynamic, it will be different on every HTML doc) 2) I need to delete the whole row (or two rows in this example).
I'm guessing it's something along the lines of setting " <tr><td>Grand Total:</td></tr><tr><td> " to a variable, then searching for everything after until it finds </td> and storing that as a variable.... and then for step two storing everything from the <tr><td>Grand Total:</td></tr><tr><td> to the next </tr> as a variable, and then using Replace to take it out of the document. I just dont know how to do the "capture everything from 1 pre-established variable to the next time the code has variable number 2 (in this case, either </td> or </tr>) part.
Any thoughts or help would be so greatly appreciated!
Thanks all!!
JE
Thanks ilssac...that's definitely helpful, as you said..mine is a little more complex as I need to find a pretty specific line of code and then find the next </td> after (actually, find all of the content between those two).
Any other thoughts? I KNOW someone else has done this. Parsing out HTML documents to capture different pieces of info has to be relatively common....
Thanks!
Similar Messages
-
X6 = "1/5/15 5:16 AM" & NOW ....................difference by Only Time
not date
X6 date and Time will be changing, Its not Constant
Dim myDateTime As DateTime = X6
Dim myDate As String = myDateTime.ToString("dd/MM/yy")
Dim myTime As String = myDateTime.ToString("hh:mm tt")
Dim myDateTime1 As DateTime = Now
Dim myDate1 As String = myDateTime1.ToString("dd/MM/yy")
Dim myTime1 As String = myDateTime1.ToString("hh:mm tt")
Need to use this function to find the Difference between Two Time. due to 12:00 AM isuue
Function XLMod(a, b)
' This replicates the Excel MOD function
XLMod = a - b * Int(a / b)
End Function
Output Required
dim dd = XLMod(myTime - myTime1)
Problem is myTime & myTime1 is String Need to convert them into Time, Later use XLMOD Funtion.Induhar,
As an addendum to this, I thought I'd add this in also: If you have two valid DateTime objects you might consider using a class which I put together a few years ago
shown on a page of my website here.
To use it, just instantiate with two DateTime objects (order doesn't matter, it'll figure it out) and you'll then have access to the public properties. For this example, I'm just showing the .ToString method:
Option Strict On
Option Explicit On
Option Infer Off
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim date1 As DateTime = Now
Dim date2 As DateTime = #1/1/1970 2:35:00 PM#
Dim howOld As New Age(date1, date2)
MessageBox.Show(howOld.ToString, "Age")
Stop
End Sub
End Class
I hope that helps, if not now then maybe at some point in the future. :)
Still lost in code, just at a little higher level.
Thanx frank, can use this in Future.... -
Need to find the Difference between two table
Hello ,
I have stucked in program as below scenario:-
I have two tables of huge data of same structure in a same schema.I need to find the difference exact values in tables.
By using MINUS we can find the difference between two table ,i need to find the what exact difference in the there values with colunm and value at that column.
Example TableA
Col1 col2 col3 col4 col5.... col50
10 ABC 2001 EE 444 TT
40 XYZ 3002 RR 445 TT3
80 DEF 6005 YY 446 YY8
TableB
Col1 col2 col3 col4 col5.... col50
10 ABC 2001 EE 444 TT
40 XYZ 3002 RR 445 TT3
81 DEF 6005 Yu 447 YY8
I need to the out put like this :-
The Diffence between two table is
TableA.COL1=80 TableB.Col1=81, Different
TableA.Col4=YY TableB.col4=Yu,Different
TableA.Col5=446TableB.col5=447,Different
Please suggest me to write the pl/sql program for the same
thanx in advance
KKThanx friends for all your efforts
I have a sample code for the same,this will compare the two tables for single row in each table .
what r the modification needed for the multiple rows of values in the two tables??
Please suggest!!
CREATE OR REPLACE PROCEDURE test_compare
IS
TYPE t_col
IS
TABLE OF VARCHAR2 (30)
INDEX BY PLS_INTEGER;
l_col t_col;
j NUMBER := 0;
l_sql VARCHAR2 (2000);
col1 VARCHAR2 (30);
col2 VARCHAR2 (30);
val1 NUMBER;
val2 NUMBER;
status VARCHAR2 (30);
CURSOR c1
IS
SELECT column_id, column_name
FROM all_tab_columns
WHERE table_name = 'TEST1';
BEGIN
FOR i IN c1
LOOP
j := j + 1;
l_col (j) := i.column_name;
END LOOP;
FOR k IN 1 .. j
LOOP
l_sql :=
'SELECT '
|| ''''
|| l_col (k)
|| ''''
|| ', '
|| 'TEST2.'
|| l_col (k)
|| ', '
|| ''''
|| l_col (k)
|| ''''
|| ', '
|| 'TEST1.'
|| l_col (k )
|| ', '
|| 'DECODE(TEST2.'
|| l_col (k)
|| ' -TEST1.'
|| l_col (k)
|| ', 0, ''NO CHANGE'', ''CHANGED'') FROM TEST2, TEST1';
EXECUTE IMMEDIATE l_sql INTO col1, val1,col2, val2, status;
IF status = 'CHANGED'
THEN
DBMS_OUTPUT.put_line( 'TEST2.'
|| col1
|| '='
|| val1
|| ', TEST1.'
|| col2
|| '='
|| val2
|| ', '
|| status);
END IF;
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Error:- ' || SQLERRM);
END;
/ -
Function Module to find the Difference between two times.
Hi All,
Wud you plz let me know the Function Module to find the Difference between two times.
Input Time1( Hours:Minutes) Time2 ( Hours:Minutes)
Need Output in Hours:Minutes only . ( No seconds Needed )
Ex :
Input :
06:00 to 18:00 Output : 12:00
and 20:00 to 06:00 Output: 10:00 with +ve sign only. No -ve sign.
Thanks,
N.L.Narayanacheck this .
data : p_timel like sy-uzeit,
p_timeh like sy-uzeit,
diff like sy-uzeit,
di(8) type c .
p_timel = '200000'.
p_timeh = '060000'.
diff = p_timeh - p_timel.
concatenate diff+0(2) ':' diff+2(2) into di.
write:/ di.
also check for this.
p_timel = '060000'.
p_timeh = '180000'.
see if this can be implemented in ur code .
or else u can try with Fm L_TO_TIME_DIFF passing startdate enddate starttime endtime with UOM as MIN
hope this helps regards,
vijay -
Intervals, synchronize the data between two oracle tables located in diffe
Hi Experts,
Is there any way I can, at set intervals, synchronize the data between two oracle tables located in different servers? What is the software, if there is any? If there are steps I can follow, so much the better.
Thanks!I'm not sure what you want to achieve here...
I want to synchronize both the Servers , so that it can update HO servers as well as Factory Server with the complete data. Could you please elaborate a little bit more; basing on your description I could also tell you how to setup timesync for those two servers if I understand "complete data" as the current date and time...
Also a lot of solutions are platform and version specific so it would help if you could indicate OS and Database Versions (4 digit).
And I still fail to see what this has to do with forms. You might want to post your question to the Database General forum: General Database Discussions
cheers -
Use of SAP memory to transfer data between two different sessions.
Hello experts,
I wish to know how to use SAP memory to transfer data between two different sessions.
The scenario is that when I run a report and change a variable, the value of changed variable should be availabe to another user on another terminal.
Thanks & Regards!
SumitHello,
Just to add what Max has already mentioned. IMPORT TO / EXPORT FROM DATABASE statements can be used to store data in special "cluster" tables (you can't use any DDIC table) e.g., INDX.
@OP: You can opt for Shared Memory(SHM) for this specific requirement as well. In my opinion SHM is a bit tricky to code, but it is easier to monitor. The opposite holds true for "data clusters".
You should remember SHM is app-server specific. So if you've a load balancing scenario, using SHM can cause problems.
Hope i'm clear.
BR,
Suhas
Edited by: Suhas Saha on Nov 19, 2010 4:12 PM -
How can I get extract the data between two cursors on an XY graph
How can I get extract the data between two cursors on an XY graph
Well, you say xy graph, so this might be a more complicated problem.
For a waveform graph it's trivial. Simply get the two cursor indices (property: cursor index) and apply them to array subset of the data. Is that all you need?
Here's how the above code would look like. using cursor.index instead of cursor.x elimnates the need to include scaling information.
For an xy graph, there could be multiple segments (e.g. imagine a spiral that passes the desired x range multiple times from both sides). This would neeed significantly more code for a general solution.
Message Edited by altenbach on 11-24-2009 07:53 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
cursorsubset.png 17 KB -
Find the difference between two columns in an ssrs matrix ? MSCRM
Hi All,
I am working in reporting part of our project (On-line MSCRM 2013) & in reporting services.
I am trying to create report using fetch xml based. Below is the snap what we required the result.
Kindly help me, how to get the difference in both column. (Its a matrix table where year is grouped).
We need difference between both year Like (Plan Revenue of 2013 & Plan Revenue of 2014 difference in Plan Revenue Diff section) and same for Actual
Revenue.
https://social.microsoft.com/Forums/en-US/054d5ca4-0d38-4dc6-84a8-88866cc228fe/find-the-difference-between-two-columns-in-an-ssrs-matrix-mscrm?forum=crmdevelopment
Thanks,
Mohammad ShariqueHi Bro,
I used parametrized option for year and done the report,Currently we are getting values in Difference column now i want to show
that value in percentage. How can we show the percentage based on that value. Means i want to show the Difference in Percentage.
Kindly help me i tried but getting some issue. Below i am mentioning the code and snap with result.
Below expression using to showing Plan Revenue in Percentage for year.
=
Sum(IIF(Fields!new_year.Value =Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
- Sum(IIF(Fields!new_year.Value =Parameters!EndYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))
/IIF(Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0)))>0,
(Sum(IIF(Fields!new_year.Value = Parameters!StartYear.Value,cdec(Fields!new_planrevenueValue.Value/1000), cdec(0))))
,1)
)*100))
Result issue is as below in snap with highlighted in red colour.
Kindly help me on this issue also :) -
Query the data between two tables
Need help for query the data between two tables
Table 1: Time sheet
P.ID P.Name EmpID HoursSpend DateTime
c12234 Test 25 4 06/12/2013
c12234 Test 25 7 06/13/2013
c12234 Test 25 8 06/15/2013
c12234 Test 5 3 06/21/2013
c12234 Test 2 5 07/15/2013
c12234 Test 25 4 07/21/2013
Table 2: cost table
EmpID FromDate ToDate Rate
25 05/01/2013 06/30/2013 250
2 04/01/2013 05/31/2013 150
25 07/01/2013 09/30/2013 300
Output
P.ID P.Name EmpID HoursSpend DateTime Rate Total (HoursSond x Rate)
c12234 Test 25 4 06/12/2013 250 1000 (4*250)
c12234 Test 25 7 06/13/2013 250 1750
c12234 Test 25 8 06/15/2013 250
2000
c12234 Test 25 4 07/21/2013 300
1200
c12234 Test 2 5 07/15/2013 150
750
===========================================
Total 28
6700
============================================
Here EmpID =2 don't have rate in the cost table on july month should be pick from last entry from cost table.Hi Gopal,
According to your description, it seems that the output needn’t include the row when EmpID=2. Because the DateTime for it in Table1 doesn’t included between FromDate column and ToDate column. After testing the issue in my environment, we can refer to the
query like below to achieve your requirement:
SELECT time.*,cost.EmpID,cost.Rate,(time.HoursSpend * cost.Rate)as [Total (HoursSond x Rate)]
FROM [Time sheet] as time
INNER JOIN
[cost table]as cost
ON time.EmpID = cost.EmpID
AND time.DateTime BETWEEN cost.FromDate AND cost.ToDate
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
SQL - Can u print all the dates between two given dates (Without PL/SQL)
Hi Friends,
I want to know if u can print all the dates between two given dates without using pl/sql.
date1,date2 are given
write a sql statement to display all the dates lying between those two dates.
An earlier will be appreciated.
Thanks in Advance
Sriram
nullSriram,
Try this....
select to_date('01-JAN-00')+to_number(rownum)
from all_tables
where rownum < to_date('10-JAN-00')-to_date('01-JAN-00')
TO_DATE('
02-JAN-00
03-JAN-00
04-JAN-00
05-JAN-00
06-JAN-00
07-JAN-00
08-JAN-00
09-JAN-00 -
Select all the dates between two txt fields. how?
In a 6i form cursor I need to select all the dates between two provided dates. I have two text fields FLD1 and FLd2 with date datatype. There is no table behind both the fields.
For example
:FLD1:='01-MAR-2013';
:FLD2:='10-MAR-2013';
Now I have to select all the dates from 01-mar-2013 to '10-mar-2013'. how to do it?Gul wrote:
In a 6i form cursor I need to select all the dates between two provided dates. I have two text fields FLD1 and FLd2 with date datatype. There is no table behind both the fields.
For example
:FLD1:='01-MAR-2013';
:FLD2:='10-MAR-2013';
Now I have to select all the dates from 01-mar-2013 to '10-mar-2013'. how to do it?As'salamualikum Gul
Try this
SELECT TO_DATE('01-MAR-2013', 'DD-MON-RRRR') - 1 + rownum AS d
FROM ALL_OBJECTS
WHERE TO_DATE('01-MAR-2013', 'DD-MON-RRRR') - 1 + rownum BETWEEN TO_DATE('01-MAR-2013', 'DD-MON-RRRR') AND TO_DATE('10-MAR-2013', 'DD-MON-RRRR')Hope this helps -
How to share the data between two or more frames
How to share the data between two or more frames based on the database relationship in JDeveloper?
You can pass data between frames by passing it as parameters.
That is when you are invoking another frame, pass your data as arguments through the constructor to that frame .
You can also achieve this through static or public methods, but static variables as we know is not suggested which might occupy more memory space.
Regards,
Srinivasan AShwath
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
How to share the data between two or more frames based on the database relationship in JDeveloper? <HR></BLOCKQUOTE>
null -
How do you find the average value of all the data between two points on a single channel
I am tring to calculate the average value of all the data points on a single plot between two seperate points
I have attahced an illustration.
Tim
Solved!
Go to Solution.
Attachments:
plot.jpg 173 KBHey smoothdurban,
I've seen Brad's code, and trust me, it's worth the effort to let him help you get it up and running - it's definitely the most ideal way to solve this problem. However, as Brad said, there are multiple ways to tackle this - both interactive and programmatic - so in the meantime, I'll take a second to detail one of the interactive and sure-fire ways to find the average of data between two points on a single channel.
We'll use"Flags." Set up your VIEW graph exactly as you did on your original screenshot, using Band Cursors to approximate the beginning and ending X-values representing the range you want to examine. Next:
1. Click the "Set Flags" button () that is a part of your 2D Axis System. Note that you can hold down the Shift button if you ever decide you want to do this on more than a single curve at one time.
2. Select the "Flags: Copy Data Points" button that enables after Flags are set.
3. This creates new channel(s) in the default (bold) group in the Data Portal that contains only the Flagged data.
4. Select DIAdem ANALYSIS.
5. Select Statistics » Descriptive Statistics.
6. In the Channels input, select the newly created channel containing your Flagged Y-Data.
7. Ensure that the Arithmetic Mean parameter is set. You can preview the data and the result in the dialog before pressing OK to execute the calculation.
You may have noticed that in the Descriptive Statistics calculation, one of the parameters that you can set is the range of channel rows to operate on - so, if you know the row numbers of your beginning and ending X-values, you could just simply run the Descriptive Statistics calculation and use this parameter to operate on a row subset of your original channel instead of the entire channel.
Derrick S.
Product Manager
NI DIAdem
National Instruments -
How to transfer app data between two different game center accounts?
Hello, I really need some help.
I have looked all over the web for ways to transfer apps between two different game center accounts and different devices. Several weeks ago I started playing Campus Life on my relative's Ipad 2, therefore spending many long hours to get to this point in the game.
The problem is I just got an Iphone 5 and I really would like to transfer the data onto it, so that I would not need to start all over again.
My grandma has an account (Game Center) onto which the data has been saved and I would like to have it stored onto mine. On some forum someone said to sign into the account which has the data on both devices and to then open up the game on the new device. It worked. Then I signed out and logged in with my own account- the game started from scratch. I panicked. I went back on the other account, and the data reappeared. I have been going back and forth, the game changing as many times. I thought it would ask to back up my grandma's data on mine but I was wrong. I can not seem to save the game onto my new account, and I have even tried to back it up to Itunes and then copy it onto my phone after having signed into my own account. And I don't know how to properly use Icloud. I am a mess. I am completely lost and have found no help on the web. (All people seem to have to deal with is sharing Apple IDs with different Game Center Accounts for the kids and transferring apps from one of their devices to another.)
I am so worried I am going to mess up and will lose the whole thing completely.
I have just started another game with my own account but since I am using my grandma's, the data is erased. It's one or the other but I definitely prefer saving Campus Life. I do not like the idea of having to only pick one.
I do not know any technical terms, so if you understand or even have the slightest clue about what I am talking about, I applaud you.
This seems like mission impossible, so if anyone can help in any way, I would be really grateful.
Thanks in advance for your time and thoughts!I meant to press on "This solved my question"... Sorry if you needed the points.
Thank-you and I will just go back and forth between the accounts. -
How to fill the data of two different tables into one?
Hi Experts,
I have two tables named CDHDR and CDSHW(structure). I have extracted the data from these two tables through two function modules named CHANGEDDOCUMENT_HEADER and CHANGEDOCUMENT_POSITION. Now I have the data in to different tables.
These two tables neither has relationship with each other through any field nor have any field which exist in both. Can anyone tell me in this case what should be the process to take the data of both the tables into one table. How can I match the record of one table to another?
thanks a ton in advance.
Edited by: Moni Bindal on Apr 28, 2008 4:16 PM
Edited by: Alvaro Tejada Galindo on Apr 28, 2008 1:42 PMHye Bindal,
without a relation, it is not possible to club the data of 2 internal tables. More over it depends on the requirement as to y u should club to non related quantities in an internal table.
if you wish to do so, one thing is it has internal table which includes the strucute of the 2.
data: begin of ty_out,
first type first_structure,
second type second_structure,
end of ty_out.
data: itab type standard table of ty_out.
data: wa type ty_out.
loop into it1 into wa1.
move corresponding wa to wa1.
append wa to itab.
endloop.
loop into it2 into wa2.
move corresponding wa to wa2.
append wa to itab.
endloop.
now the internal table itab will have all the contents of it1 and it2.
<REMOVED BY MODERATOR>
Thanks,
Imran.
Edited by: Alvaro Tejada Galindo on Apr 28, 2008 1:43 PM
Maybe you are looking for
-
Bank Gurantees & Letter of Credit
Pls explain how bank gurantees and Letter of credit customizin and procee of above field explain me with exampls any documents appreciated [email protected] Edited by: Madhava Venkat on Jul 2, 2008 8:56 AM
-
I own an iPad 2 and love it, feeding it with new apps on a regular basis. However it does have obvious shortcomings and I'm seriously thinking of buying another tablet that has features which are missing. Keyboard I'll start with the the most common
-
when navigating on certain sites (fiverr.com is one), i get the popup confirmation "This web page is being redirected to a new location. Would you like to resend the form data you have typed to the new location?" this is highly annoying and i can't f
-
Problem to install 10.6 on a iMac
Daer all, I have a small problem. I actually have an iMac with 10.5.8 (German version). I would like to install en ENglish version 10.6. I encraved the 3 file/folders (Mac OS X Installation, Optional Installs, Instruction) into a DVD and then I run t
-
Favorites iView generates wrong link
Hi, i use the standard portal favorites iView. I added the standard "news" page (from eu_role) over the page title tray as favorite to the portal favorites iView. After clicking the added entry in the portal favorites iView, i get following link rend