473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Logic Troubles - reading in a difficult textfile

Hi everyone,

I have a textfile which I need to read and compare dates. The text file
summarizes every time I do an update to an internet site. Sample output
is as follows:

Copying humanresources\compensation files from tcinfotest to tcinfo
-----------------------
Start Time:
Tue 01/03/2006
7:26a
-----------------------
D:\tcinforoot\humanresources\compensation\employee \pay\hrkit.htm ->
F:\humanresources\compensation\employee\pay\hrkit. htm
D:\tcinforoot\humanresources\compensation\employee \pay\incometax.htm ->
F:\humanresources\compensation\employee\pay\income tax.htm
D:\tcinforoot\humanresources\compensation\forms\al berta06.pdf ->
F:\humanresources\compensation\forms\alberta06.pdf
6 File(s) copied
-----------------------
End Time:
Tue 01/03/2006
7:26a
-----------------------
Copying ressourceshumaines\remuneration files from tcinfotest to tcinfo

-----------------------
Start Time:
Tue 01/03/2006
7:27a
-----------------------
D:\tcinforoot\ressourceshumaines\remuneration\empl oye\paie\taxes.htm ->
F:\ressourceshumaines\remuneration\employe\paie\ta xes.htm

2 File(s) copied
-----------------------
End Time:
Tue 01/03/2006
7:27a
-----------------------

I am creating a form with two DateTimePickers for the user to select
the date periods in which he/she wants to report on. I'm having trouble
with the logic of the loops.

So the two dates are read in using "Date1.Text" and "Date2.Text" (User
inputs). I have a customformat on the datetimepicker so that it is the
same as the output in the textfile. SO now, I am trying to compare the
dates.

If the beginning date is in the textfile, I want to display every line
until the last entry of the end date. So then i'll have the right time
right period. When I get the information, I plan to format it, but I
know how to do that, i'm just stuck on the logic.

If someone could help it would be awesome. Thanks.
Justin Fancy

Nov 29 '06 #1
1 1407
Try this:
-------------

Public Sub GetDataFromDates(StartDate as date, EndDate as date)
'Opening and reading file method
'.
'.
'We will assume you place the date read from the file in D1 variable...

While SR.Peak <-1
if D1 <= EndDate And D1 =StartDate
'Do work. Print the date and data...
elseif D1 EndDate
'The date is past the end date.
'Close the StreamReader
SR.Close
'Exit the Sub
Exit Sub
End If
End Sub
------------
The problem is what if you have a date the is after the end date? Hope this
helps.
--
--
Thiele Enterprises - The Power Is In Your Hands Now!
--
"Justin Fancy" <ju*********@gmail.comwrote in message
news:11*********************@j72g2000cwa.googlegro ups.com...
Hi everyone,

I have a textfile which I need to read and compare dates. The text file
summarizes every time I do an update to an internet site. Sample output
is as follows:

Copying humanresources\compensation files from tcinfotest to tcinfo
-----------------------
Start Time:
Tue 01/03/2006
7:26a
-----------------------
D:\tcinforoot\humanresources\compensation\employee \pay\hrkit.htm ->
F:\humanresources\compensation\employee\pay\hrkit. htm
D:\tcinforoot\humanresources\compensation\employee \pay\incometax.htm ->
F:\humanresources\compensation\employee\pay\income tax.htm
D:\tcinforoot\humanresources\compensation\forms\al berta06.pdf ->
F:\humanresources\compensation\forms\alberta06.pdf
6 File(s) copied
-----------------------
End Time:
Tue 01/03/2006
7:26a
-----------------------
Copying ressourceshumaines\remuneration files from tcinfotest to tcinfo

-----------------------
Start Time:
Tue 01/03/2006
7:27a
-----------------------
D:\tcinforoot\ressourceshumaines\remuneration\empl oye\paie\taxes.htm ->
F:\ressourceshumaines\remuneration\employe\paie\ta xes.htm

2 File(s) copied
-----------------------
End Time:
Tue 01/03/2006
7:27a
-----------------------

I am creating a form with two DateTimePickers for the user to select
the date periods in which he/she wants to report on. I'm having trouble
with the logic of the loops.

So the two dates are read in using "Date1.Text" and "Date2.Text" (User
inputs). I have a customformat on the datetimepicker so that it is the
same as the output in the textfile. SO now, I am trying to compare the
dates.

If the beginning date is in the textfile, I want to display every line
until the last entry of the end date. So then i'll have the right time
right period. When I get the information, I plan to format it, but I
know how to do that, i'm just stuck on the logic.

If someone could help it would be awesome. Thanks.
Justin Fancy
Nov 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Suchi | last post by:
Hi all: I want to read a textfile from an ASP program. My program is like this: Set fso = CreateObject("Scripting.FileSystemObject") workFile=http://localhost/Readme.txt) Set textFile =...
2
by: BjoernJackschina | last post by:
Hello, I just look for a capability to sort several words in view of alphabet. An example: stop is 'opst' reach is 'aechr' This should read in a new file so that I can look for same letter...
16
by: Roy | last post by:
I use a Access 2K application.I am trying to use Chuck Grimsby(clsReadTextFile.txt)class utility to read a text file and then do a import of the same into my database.The question is how to call...
2
by: chris | last post by:
Hi there, I am reading in a textfile which looks like this (there is no new line after the last number) 03 98661881 0407 566453 The code to load the textfile looks like this:
2
by: novacreatura | last post by:
Hi, I have a project that's supposed to create a program for a "Dating Service". The first part of the program is to read a textfile of profiles which include names, age, etc...into a string...
73
by: JoeC | last post by:
I am writing a game and I am having a challenge with my combat function. All I want to do is find out how to group pieces that are in the same space. There are two sides and all the units that...
6
by: =?Utf-8?B?UmljaA==?= | last post by:
'--this code works but only reads text into one column when contains multiple cols Dim ds1x As New DataSet Dim ConStr As String = _ "Provider=Microsoft.Jet.OLEDB.4.0;Data...
3
by: Arn | last post by:
I just started to learn C++ and have some problem when I read a hole line from a textfile. I would be grateful if anyone can tell me what is wrong with my code. I'm using Borland Developer Studio...
1
by: asedt | last post by:
With my Excel macro and two text files I want to create a new textfile containing the first textfile then text from the sheet and then the second textfile. My problem is that i don't know how to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.