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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:43:24+00:00 2026-05-14T07:43:24+00:00

I am trying to achieve a situation where i load a file into the

  • 0

I am trying to achieve a situation where i load a file into the program.
I can use streamreader for this.
Each record will be 7 lines long.
Therefore lines 1,8,15,22,etc will all hold the same value.
As will 2,9,16,23, etc and so on.

What is the best way to achieve this? So that when i load the records in the listview, it recognises what i just said.
Thanks

  • 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-05-14T07:43:24+00:00Added an answer on May 14, 2026 at 7:43 am

    When you say that lines 1, 8, 15 etc will all hold the same value, do you actually mean that they hold the same type of value? Otherwise, why read in more than the first 7 lines?

    I think something like the below might work (not tested the code).

    string data;
    using(System.IO.StreamReader reader = new System.IO.StreamReader("filepath"))
    {
        data = reader.ReadToEnd();
    }
    
    string[] lines = data.Split(Environment.NewLine);
    
    for(int index = 0; index < lines.Length; index += 7)
    {
        ListViewItem item = new ListViewItem();
        for(int innerIndex = 0; innerIndex < 7; innerIndex++)
        {
            item.SubItems.Add(lines[index + innerIndex]);
        }
    
        listView1.Items.Add(item);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to achieve this kind of formatted data from my select statement
I'm trying to achieve urls in the form of http://localhost:9294/users instead of http://localhost:9294/#/users This
I am trying to get some data from remote server. To achieve this I
I am trying to resolve a situation I ran into when implementing EF with
I have a tricky situation in trying to get information from multiple queries into
I'm having a weird situation that I'm trying to understand. This piece of code
This question has already been asked in a different situation . I am trying
this is my situation, I have a Post model that can belong to multiple
I'll explain what I'm trying to achieve: I want to have a situation where
Trying to achieve any moving effect while appending an element from one to another

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.