Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6657765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:48:38+00:00 2026-05-26T01:48:38+00:00

I would like to know who can I retrieve the date from a file.

  • 0

I would like to know who can I retrieve the date from a file.

This is how I open my file:

    Set fs=Server.CreateObject("Scripting.FileSystemObject")

    Set f=fs.OpenTextFile(Server.MapPath("checkno_2211.html"), 1)
'Need something here to find the first date MM/DD/YYYY in the file
    f.Close

    Set f=Nothing
    Set fs=Nothing

The code above will open the .html file now I would like to find the first date that is in that file but I don’t know how to do it. 🙁

The .html file will have multiple dates in it, but I only need to grab the first one.
The html and format of the date is like this:

<TD class="auto-style32" style="height: 31px">
Date:
 10/7/2011</TD>

The source code of the .html file is

        <HTML>
        <HEAD>
        <script SRC="include/general.js" language="javascript" type="text/javascript"></script>
        <style type="text/css">
        textarea { 
font-size: 14px;
font-weight: bold;
font-family: Arial;
}

.style1 {
    text-align: center;
}
.style2 {
    border-style: solid;
    border-width: 1px;
}
.style3 {
    color: #FFFFFF;
    background-color: #000000;
}
.style4 {
    background-color: #000000;
}
.style5 {
    color: #FFFFFF;
}
.style7 {
    vertical-align: text-bottom;
}
.style8 {
    font-family: Arial, Helvetica, sans-serif;
}
.style9 {
    background-color: #C0C0C0;
}
.style10 {
    vertical-align: middle;
}

        .auto-style30 {
            text-align: center;
            margin-left: 0px;
        }

        .auto-style32 {
            text-align: left;
            border-bottom-style: solid;
            border-bottom-width: 1px;
        }

        .auto-style35 {
            background-color: #000000;
        }
        .auto-style36 {
            border-top-style: solid;
            border-top-width: 1px;
        }

        </style>

<script language="javascript" type="text/javascript">
function GetURL_Alpha(){
document.getElementById("currentURL").value= location.href;
}
</script>

        <script SRC="include/general.js" language="javascript" type="text/javascript"></script>
        </HEAD>
        <BODY onload="printIt();GetURL_Alpha();" style="margin: 0 5">



<input name="currentURL" ID="currentURL" type="hidden" style="width: 1528px">

<CENTER>


<head>
<style type="text/css">
.auto-style36 {
    text-align: center;
}
</style>
</head>

    <TABLE border=0 style="width: 100%">
    <TR>
        <TD class="auto-style36">
        <font face="Century Gothic">
        <img src="logopro2.jpg"><BR>
            </font>
            <strong>
            <font face="Century Gothic" size="1">111 Test Main St Los Angeles, 
        CA 12345 </font></strong><font face="Century Gothic" size="1">
        <strong><BR>
            </strong>
            </font> <STRONG><FONT face="Century Gothic" size=1>PHONE: (888) 111-2222&nbsp;&nbsp;&nbsp;&nbsp;FAX: (877) 
        111-2233</FONT></STRONG>
        <br><br>
            </TD>
    </TR>
    </TABLE>
    </CENTER>
<table style="width: 100%">
<tr>
<td style="width: 408px"><font face="Arial">
<strong>
<h3 class="auto-style30" style="width: 492px">
FULL NAME<BR>
123 Test Ave<BR>
MIAMI, FL<BR>
</h3>
</strong>
</font>
&nbsp;</td>
<td>
</td>
<td>
&nbsp;</td>
</tr>
</table>

            <P align = center>
            <FONT face="Comic Sans MS" size=5><span class="style8">
<HR>
            <P align=center>
            <TABLE border=0 style="width: 100%" cellspacing="0">
                <tr>
            <FONT face="Comic Sans MS" size=5><span class="style8">
                <TD class="auto-style32" style="height: 31px">
                    Date:
                     10/7/2011</TD>
                <td style="height: 31px">Name:&nbsp;Someone</td>
                    <td class="style1" colspan="2" style="height: 31px">
            <FONT face="Comic Sans MS" size=5><span class="style8">
                    <strong>STATEMENT</strong></td>
                <TD colspan=3 align=right style="height: 31px">
                    Check #: 11008 
                </TD>
                    </span></font>
                </tr>
            <TR>
                <TD colspan=7 align=center class="auto-style35">
                    <span class="style5"></span>
                    <STRONG><FONT face="Arial" size=2 color="white">
                    <img src="more_images/ContainerRed.png" class="style10"> 
                    MORE INFORMATION</FONT></STRONG>                
                </TD>
            </TR>   

As always,
Thanks for any help…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:48:39+00:00Added an answer on May 26, 2026 at 1:48 am

    You could try something like this –

    Dim ParseDate, NextLineIsDate 
    NextLineIsDate = False
    Set fso = Server.CreateObject("Scripting.FileSystemObject") 
    set fs = fso.OpenTextFile(Server.MapPath("Saved\checkno_2211.html"), 1, true) 
    Do Until fs.AtEndOfStream 
        If NextLineIsDate Then
           ParseDate = Replace(Replace(fs.ReadLine," ",""),"</TD>","")
           Exit Do
        End If
        If Instr(fs.ReadLine,"Date:") > 0 Then NextLineIsDate = True
    Loop 
    Response.Write ParseDate 
    fs.close: set fs = nothing 
    

    The code above should output the date you’re searching for to the screen.

    This will work providing the text Date: only appears directly above dates in your text file. If it doesn’t you might need some thing more complicated but it’s hard to tell without seeing all the contents of your file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know who is locking a file (win32). I know about
I would like to know if I can open 2 different diagrams using MS
I would like to know from highly experienced Java professionals who have worked with
Our customer would like to know who is online and currently using the custom
i would like know some reference. I know i can googling it. but prefer
Would like to know the c# code to actually retrieve the IP type: Static
I would like to copy the value of a input:file to input:text. I can
Before I pursue this, I would first like to know if it's possible. So,
CentOS 5.3 subversion 1.4.2 Our company would like to know who has checked out
I would like to know if anyone can help me with my method. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.