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 8978411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:36:22+00:00 2026-06-15T19:36:22+00:00

I have a text file which I parse and load parsed results into a

  • 0

I have a text file which I parse and load parsed results into a collection. I have completed the parsing and have loaded the results into a collection object.

public class Results
{
  List<Node> nodes = new List<Node>();

}
public class Node
{
  public int id {get;set;}
  public DateTime initiationDateTime {get;set;}
}

The next step is to iterate through each list item and if the timestamp difference is more than 30 minutes from the previous minimum date/time then it will be stored as a user selection. for instance from the following recordset the users will view the following choices in the form of checboxes. All I am trying to figure out is how to form the user selection list. Once I show the user selection list to the user, they will re-post the page with their selections and based on the date ranges I will process the records within a selected date range.

User Choices:
1/12/2012 10:09 -  1/12/2012 10:49 
1/12/2012 13:25 -  1/12/2012 13:26
1/12/2012 15:30

    Parsed List:

ID    Test Initiation       InitiationChoice    CompletionChoice
1       1/12/2012 10:09           Yes              
2       1/12/2012 10:09
3       1/12/2012 10:09
4       1/12/2012 10:09
5       1/12/2012 10:09
6       1/12/2012 10:09
7       1/12/2012 10:48
8       1/12/2012 10:48
9       1/12/2012 10:49
10      1/12/2012 10:49
11      1/12/2012 10:49
12      1/12/2012 10:49                               Yes
13      1/12/2012 13:25           Yes
14      1/12/2012 13:25
15      1/12/2012 13:25
16      1/12/2012 13:25
17      1/12/2012 13:26
18      1/12/2012 13:26                                 Yes
19      1/12/2012 15:30           Yes

The following is my attempt to create the users choices, Would appreciate suggestions on this

        //First Minimum Date to start as i have already sorted this list based on date.
        minimumDateTime = lf.Nodes.ElementAt(0).InitiationDate; 

        foreach (Node rb in lf.Nodes)
        {
            TimeSpan intervalMinutes = rb.InitiationDate.Subtract(minimumDateTime);
            UserConfirmationErrors confirmationRun = new UserConfirmationErrors();

            if (intervalMinutes.TotalMinutes >= 30)
            {
                //New Minimum Date/Time
                minimumDateTime = rb.InitiationDate;
            }

        }
  • 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-06-15T19:36:23+00:00Added an answer on June 15, 2026 at 7:36 pm

    I’d do this:

    • create a collection, such as List<DateTime> minDates
    • push new min dates into collection
    • convert your collection into a List<SelectListItem>
    • on postback, the value will be the min date (not the range). You know that given a min date you can always find the range: just add 30 minutes.

    Thus, my pseudo example looks like this:

        minimumDateTime = DateTime.Min; // don't force to first record.. let loop do it
        var minDates = new List<DateTime>();
    
        foreach (Node rb in lf.Nodes)
        {
            TimeSpan intervalMinutes = rb.InitiationDate.Subtract(minimumDateTime);
            UserConfirmationErrors confirmationRun = new UserConfirmationErrors();
    
            if (intervalMinutes.TotalMinutes >= 30)
            {
                //New Minimum Date/Time
                minimumDateTime = rb.InitiationDate;
                minDates.Add(minimumDateTime); // add to new collection
            }
    
        }
    
    // now loop your minDates to create your select list
    var items = new List<SelectListItem>();
    foreach(var minDate in minDates)
    {
      var item = new SelectListItem() { Value = minDate.ToString(), Text = String.Format("{0} - {1}", minDate, minDate.AddMinutes(30) };
    
      items.add(items);
    }
    
    // now items is your collection that you can bind your select list to...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file which I'd like to parse into a non-XML (text)
I have a huge text file which I want to explode into an array.
I have a data structure object which is loaded from an XML file inside
I have a text file which I'm trying to parse. The file looks like
I have a text file ~6GB which I need to parse and later persist.
I have a text file which has a particular line something like sometext sometext
I have a text file which I am reading and storing the data in
I have a text file which contains data seperated by '|'. I need to
I have a text file which I want to filter using awk. The text
I have a text file which needs to be constantly updated (regular intervals). All

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.