How to get value from text box (string)

I have following string in textbox now I want to fetch some of the data and put into another textbox.

Within this string -
"<TH class=displaytable_attribute scope=col>GC No.</TH>"
i want only GC No. in label1 and its value from  this line  is 15470038084 in text box 1
"<TD style="COLOR: #000000" class=displaytable_value><A style="BACKGROUND-COLOR: yellow">15470038084</A></TD>"
and same for the rest of the value like
for GC Date in label3 and its value in text box 3
<TH class=displaytable_attribute scope=col>GC Date</TH>
and value  is
<TD class=displaytable_value>23/10/2017</TD>

 and so on for the rest of the fields........

hope you understand what i want

plz assist me how to do that

thanks in advance

Data I have in the following format

<TD class=style1><BR><BR>&nbsp;<A href="Index.aspx"><IMG style="HEIGHT: 41px" src="images1/1ee.jpg"></A></TD>
<TD><BR><BR>&nbsp;&nbsp;&nbsp; </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
<TD style="WIDTH: 750px; HEIGHT: 100px">&nbsp;<BR><A class=Heading_TrackingDetails name=tracking>Tracking Details </A><BR><BR>
<TABLE cellSpacing=0 width="100%">
<TD class=cellborder_none colSpan=6 border="0"><B>Booking Details</B></TD></TR>
<TH class=displaytable_attribute scope=col>GC No.</TH>
<TH class=displaytable_attribute scope=col>GC Date</TH>
<TH class=displaytable_attribute scope=col>GC Time</TH>
<TH class=displaytable_attribute scope=col>From</TH>
<TH class=displaytable_attribute scope=col>To</TH>
<TH class=displaytable_attribute scope=col>Consignor</TH>
<TH class=displaytable_attribute scope=col>Consignee</TH>
<TH class=displaytable_attribute scope=col>Qty</TH>
<TH class=displaytable_attribute scope=col>Weight</TH>
<TH class=displaytable_attribute scope=col>Inv_No</TH></TR>
<TD style="COLOR: #000000" class=displaytable_value><A style="BACKGROUND-COLOR: yellow">15470038084</A></TD>
<TD class=displaytable_value>23/10/2017</TD>
<TD class=displaytable_value>12:00:00 AM </TD>
<TD class=displaytable_value>VARANASI</TD>
<TD class=displaytable_value>SHOLAPUR</TD>
<TD class=displaytable_value>MUSKAN SAREE</TD>
<TD class=displaytable_value>CHATLA SAREE</TD>
<TD class=displaytable_value>3</TD>
<TD class=displaytable_value>90</TD>
<TD class=displaytable_value>X</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 width="100%">
Altaf PatniSoftware DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pawan KumarDatabase ExpertCommented:
What language are u using?
Altaf PatniSoftware DeveloperAuthor Commented:
thanks for reply Pawan

i am using vb6.0
David Johnson, CDRetiredCommented:
normally I'd use in the code behind

var abc = textbox1.text
textbox2.txt = abc
Martin LissOlder than dirtCommented:
I assume that the data comes from a txt file. I've attached the text file that I used and a project that processes it. To test it you will need to save the file to some folder and then change the Open "C:\temp\29067879.txt" For Input As #FF line in the code.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hopefully this code is near to what you need.
Option Explicit

Private Sub Command1_Click()
    Dim lStart As Long
    Dim strElement As String
    Dim i As Integer
    Dim strValue As String
    Dim Labels(10) As String
    Dim Values(10) As String
    lStart = 1
    'Get table header text
    For i = 1 To 10
        lStart = GetNextElement(Form1.Text1.Text, lStart, "TH", strElement, strValue)
        If lStart = 0 Then
            Exit Sub
        End If
        Labels(i) = strValue
        lStart = lStart + Len(strElement)
    Next i
    'get table call text
    For i = 1 To 10
        lStart = GetNextElement(Form1.Text1.Text, lStart, "TD", strElement, strValue)
        If lStart = 0 Then
            Exit For
        End If
        Values(i) = strValue
        lStart = lStart + Len(strElement)
    Next i
    'transfer text from arrays to text box
    For i = 1 To 10
        Form1.Text2.Text = Form1.Text2.Text & Labels(i) & ": " & Values(i) & vbCrLf
    Next i
End Sub

Function GetNextElement(strHTML As String, lCurrentPosition As Long, strTag As String, strElement As String, strValue As String) As Long
    Dim lStart As Long
    Dim lEnd As Long
    lStart = InStr(lCurrentPosition, strHTML, "<" & strTag & " ", vbTextCompare)
    If lStart > 0 Then
        lEnd = InStr(lStart, strHTML, "</" & strTag & ">", vbTextCompare)
        If lEnd > 0 Then
            strElement = Mid(strHTML, lStart, lEnd - lStart + 5)
            GetNextElement = lStart
        End If
        strValue = GetValue(strElement, strTag)
    End If
End Function

Function GetValue(strElement As String, strTag As String) As String
    Dim lAttrEnd As Long
    lAttrEnd = InStr(1, strElement, ">", vbTextCompare) + 1
    GetValue = Mid(strElement, lAttrEnd, Len(strElement) - lAttrEnd - Len("</" & strTag))
End Function

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.