|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Logic Troubles - reading in a difficult textfileI 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\incometax.htm D:\tcinforoot\humanresources\compensation\forms\alberta06.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\employe\paie\taxes.htm -> F:\ressourceshumaines\remuneration\employe\paie\taxes.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 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" <justinfa***@gmail.com> wrote in message I have a textfile which I need to read and compare dates. The text filenews:1164807949.610286.91200@j72g2000cwa.googlegroups.com... Hi everyone, 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\incometax.htm D:\tcinforoot\humanresources\compensation\forms\alberta06.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\employe\paie\taxes.htm -> F:\ressourceshumaines\remuneration\employe\paie\taxes.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
How do you translate your WinForms app? (outsourcing localization)
How to recognize a Command Line parameter? Attaching multiple files of any type to a mail message? Looking for a simple explanation of how to walk through a dataset in .net 2.0 Need pre-built report administration application Its Urgent: I have export database into excel file if office not installed then it gives me error Add new record to database Where is the VS mru list file stored? how sql xml query to get empty element tag Create a Deployment Package! |
|||||||||||||||||||||||