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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:45:39+00:00 2026-06-18T02:45:39+00:00

I have a file with lines of string. Each line represent a collection of

  • 0

I have a file with lines of string. Each line represent a collection of key value, for example:

Name=JUI;Type=HomeUser;Address=Belgium;Address=Liege;Address=Street
Name=Tim;Type=HomeUser;Address=Belgium;Address=Hasselt;Address=Street
Name=Kim;Type=Proff;Address=Germany;Address=Dusseldorf;Address=Street
Name=Ils;Type=Proff;Address=Germany;Address=Munich;Address=Street
Name=Jan;Type=Student;Address=Germany;Address=Frankfurt;Address=Street
Name=Dav;Type=Student;Address=France;Address=Mitz;Address=Street
Name=Soli;Type=HomeUser;Address=France;Address=Lyon;Address=Street
Name=Mik;Type=HomeUser;Address=Switzerland;Address=Zurich;Address=Street
Name=Peter;Type=Blocked;Address=Netherland;Address=Enschede;Address=Street 
Name=Maz;Type=Blocked;Address=Germany;Address=Achen;Address=Street
Name=Jo;Type=Teacher;Address=Belgium;Address=Antwerpen;Address=Street

How can I do the following:

  1. Get the names where type is HomeUser
  2. Get the types where Address =Germany (problem there are 3 address key in earch line)
  3. Get the name where address =Lyon

Is there is a simple way to do that?

  • 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-18T02:45:40+00:00Added an answer on June 18, 2026 at 2:45 am

    In all of these cases, the answer is really simple when you’ve got a better data representation – you can just use LINQ.

    However, the first step will be to parse the data. Model it something like this:

    public class User // ???
    {
        public string Name { get; private set; }
        public string Type { get; private set; } // Should this be an enum?
        public IList<string> Addresses { get; private set; }
    
        // Could make this a constructor if you really want... I like the
        // explicit nature of the static factory method.
        public static User ParseLine(string line)
        {
            // TODO: Split line into components etc
        }
    }
    

    One you’ve got a List<User> your queries will be really easy – but it’s important to separate “put data into a more natural representation” from “do interesting operations with data”.

    This is a much more general point than just this particular example, but always try to get your data into a natural, useful representation as early as you can, and then keep it in that representation for as long as you can. Only deal with an awkward representation (typically a string) at the boundaries of your code, if possible.

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

Sidebar

Related Questions

I have a file called messages.properties which has lines with syntax <key>=<string> . Each
I have a file have multiple lines. For each line the format is String
Essentially I have a file of lines of integers. Each line has 9 digits.
I have a file with many lines, in each line there is either substring
I have a *.TXT file full of about 1 - 200 lines. Each line
I have a file containing some lines of code followed by a string pattern.
I have a file named file with three lines: line one line two line
Suppose I have a file containing some lines: line 1 ... line 2 ...
I have a file containing lines of the form, double mass, string seq, int
I have a file LIST that has a sequence of characters per line. Each

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.