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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:31:09+00:00 2026-06-15T10:31:09+00:00

I have an MVC web app where users upload a text file and I

  • 0

I have an MVC web app where users upload a text file and I parse it out.

The requirement just changed and they will be uploading multiple files of the same kind now. I parse a single file by sending a file-path to the method below, ReadParts which opens a stream and calls the method parseReplicateBlock to retrieve desired fields. For multiple files I could read all the files into one big stream but I am afraid it could exceed the buffer limit etc.

So I am thinking to parse file by file and populate results into an object. My requirement then, is to sort the records based on a date field.

I just need some help in how to write this method ReadLogFile in a better way, espceially for sorting based on initialtionDate and initiationTime. I want to find the minimum record based on initiationDate and Time and then do some other logic.

The problem is if I sort the list member within the object, I would loose positiong of the other records.

  • 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-15T10:31:11+00:00Added an answer on June 15, 2026 at 10:31 am

    You appear to be storing each field of the record in a separate collection within LogFile. This seems a very strange way to store your data.

    If you sort one of these collections, then of course it will bear no relationship to the other fields any longer since they are unrelated. There are huge areas for bugs too if you are relying on all the collections tallying up (eg if a field is missing from one of the parsed records)

    Instead you should be have a class that represents a SINGLE record, and then Logfile has a SINGLE collection of these records. eg:

    public class ReplicateBlock
    {
        public string   ReplicateId    { get; set; }
        public string   AssayNumber    { get; set; }
        public DateTime InitiationDate { get; set; }
        //etc
    }
    
    public class LogFile
    {
        public List<ReplicateBlock> ReplicateBlocks = new List<ReplicateBlock>();
    }
    

    I have to say that your code is very difficult to follow. The fact that all your functions are static makes me think that you’re not particularly familiar with object oriented programming. I would suggest getting a good book on the subject.

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

Sidebar

Related Questions

Background I have a page on my ASP.NET MVC web app for users to
We have an ASP.NET MVC web app which allows users to publish messages onto
We have created ASP.NET MVC app which accept file upload (up to 80mb) and
I have a spring web app that uses Hibernate and Velocity. It's an MVC
I have C# MVC web app that has some textboxes that in IE9 you
I have an object which contains models for my ASP.NET MVC web app. The
Im trying to develop my first ASP.NET MVC web app and have run into
I have a web app (MVC) where I need some automatic service to run
I have configured in following way that spring MVC app using Spring 3.1.1.RELEASE web.xml
I have developed a MVC web application with ASP.NET MVC and im just wondering

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.