Results 1 to 25 of 25

Thread: VB.NET read text file data between two dates

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2021
    Posts
    191

    VB.NET read text file data between two dates

    Hi All.. how can I read data from a text file between two dates? Right now I am just going back X-days from today with this from a comma delimited text file:

    Code:
    Dim lines = IO.File.ReadAllLines(filename)
    For Each line In lines
        Dim Data = line.Split(","c)
        If (CDate(Data(4)) > DateTime.Now.AddDays(-CInt(HowMnyDays))) Then
    Thanks in advance.

    Example Data:
    Code:
    8-879003-02_BTM,B1022,741,55,4/18/2022 6:33:49 AM,LiTran,Wrong Prep,Color [DarkOrchid],A2523217,
    8-879003-02_BTM,B1022,857,59,4/18/2022 6:33:59 AM,LiTran,Wrong Prep,Color [DarkOrchid],A2523217,
    8-879003-02_BTM,B1022,1024,55,4/18/2022 6:34:02 AM,LiTran,Wrong Prep,Color [DarkOrchid],A2523217,
    8-879003-02_BTM,B1022,284,669,4/18/2022 6:34:13 AM,LiTran,Wrong Prep,Color [DarkOrchid],A2523217,
    8-879003-02_BTM,B1022,544,673,4/18/2022 6:34:17 AM,LiTran,Wrong Prep,Color [DarkOrchid],A2523217,
    8-879003-02_BTM,B1022,724,677,4/18/2022 6:34:21 AM,LiTran,Wrong Prep,Color [DarkOrchid],A2523217,
    8-879003-02_BTM,B1022,1000,667,4/18/2022 6:34:26 AM,LiTran,Wrong Prep,Color [DarkOrchid],A2523217,
    8-879003-02_BTM,B1022,1039,672,4/18/2022 6:34:29 AM,LiTran,Wrong Prep,Color [DarkOrchid],A2523217,
    8-879003-02_TOP,B1023,930,175,4/18/2022 6:35:12 AM,LiTran,No Solder,Color [LightSkyBlue],A2523217,
    8-879003-02_TOP,B1023,845,232,4/18/2022 6:37:24 AM,LiTran,Missing Part,Color [Yellow],A2523217,
    8-879003-02_TOP,B1023,489,375,4/18/2022 6:51:39 AM,LiTran,Missing Part,Color [Yellow],A2523217,
    4-946020-12_BTM,-5345,66,265,4/18/2022 9:27:38 AM,thvan,Insuff Solder,Color [Orange],A2524939,
    4-946020-12_BTM,-5345,510,231,4/18/2022 9:28:24 AM,thvan,Insuff Solder,Color [Orange],A2524939,
    4-946020-12_BTM,-5345,485,324,4/18/2022 9:29:00 AM,thvan,Insuff Solder,Color [Orange],A2524939,
    4-946020-12_BTM,-5345,567,136,4/18/2022 9:29:36 AM,thvan,Solder Bridge,Color [Chartreuse],A2524939,
    4-946020-12_BTM,-5345,593,469,4/18/2022 9:30:05 AM,thvan,Solder Bridge,Color [Chartreuse],A2524939,
    4-946020-12_BTM,-5346,65,268,4/18/2022 9:32:03 AM,thvan,Insuff Solder,Color [Orange],A2524939,
    4-946020-12_BTM,-5346,509,234,4/18/2022 9:32:56 AM,thvan,Insuff Solder,Color [Orange],A2524939,
    4-946020-12_BTM,-5346,493,311,4/18/2022 9:33:48 AM,thvan,Insuff Solder,Color [Orange],A2524939,
    4-946020-12_BTM,-5346,567,460,4/18/2022 9:35:50 AM,thvan,Solder Bridge,Color [Chartreuse],A2524939,
    4-946020-12_BTM,-5347,70,275,4/18/2022 9:37:06 AM,thvan,Insuff Solder,Color [Orange],A2524939,
    4-946020-12_BTM,-5347,513,235,4/18/2022 9:37:55 AM,thvan,Insuff Solder,Color [Orange],A2524939,
    Last edited by mikeg71; Apr 19th, 2022 at 09:06 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width