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

  • Home
  • SEARCH
  • 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 7849275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:27:49+00:00 2026-06-02T18:27:49+00:00

I have to parse several comma-separated files containing headers via a generic parser. The

  • 0

I have to parse several comma-separated files containing headers via a generic parser. The headers come in great number, and I need to provide the ability to choose the few headers that matter.

The concrete parsers that implement my generic one for each file type have to override an onLine(IDictionary|string,string| line) method among others. This line maps header value to corresponding data in the line.

My problem : I use a comma-separated list in my app.config at the moment. The problem of that is that my concrete parsers will have to use actual header values as keys. I’d like to be able to introduce constants, so that no rebuild is necessary in case a header changes.

at the moment my app.config looks like this :

  <configSections>
    ...
    <section name="headers" type="System.Configuration.NameValueSectionHandler" />
    ...
  </configSections>
  ...
  <headers>
    ...
    <add key="file1" value="actualheader1,actualheader2,actualheader3" />
    <add key="file2" value="actualheader4,actualheader5,actualheader6" />
    <add key="file3" value="actualheader7,actualheader8,actualheader9" />
    ...
  </headers>
  ...

I would need something like (no requirements in terms of what is tag, key, value, just trying to show the logic I am after):

  <configSections>
    ...
    <section name="headers" type="?" />
    ...
  </configSections>
  ...
  <headers>
    ...
    <file1>
      <add key="headerconstant1" value="actualheader1" />
      <add key="headerconstant2" value="actualheader2" />
      <add key="headerconstant3" value="actualheader3" />
    </file1>
    <file2>
      <add key="headerconstant4" value="actualheader4" />
      <add key="headerconstant5" value="actualheader5" />
      <add key="headerconstant6" value="actualheader6" />
    </file2>
    <file3>
      <add key="headerconstant7" value="actualheader7" />
      <add key="headerconstant8" value="actualheader8" />
      <add key="headerconstant9" value="actualheader9" />
    </file3>
    ...
  </headers>
  ...

The second option would enable changes in the actual header value to find in files without impacting the code.

How can I do this ? I there any quickfix already implemented ?

  • 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-02T18:27:50+00:00Added an answer on June 2, 2026 at 6:27 pm

    If you want to do it with the config but don’t want the learning curve of hand coding up the your config section check out http://csd.codeplex.com/ for a visual studio addin. Very clean and easy to understand.

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

Sidebar

Related Questions

I have several large .xml files. I want to parse out the files to
I have a problem which requires me to parse several log files from a
I need to use XmlDocument or HAP to parse several files, what is the
I have several strings that I need to parse. The string is supposed to
I have text file with several thousands lines. I want to parse this file
I have several entity classes that I use for parsing fixed width text files
I have several variables that I need to send from page to page... What
I have to split a string into several ones. In fact what i need
I have a stack of CSV files I want to parse - the problem
I have an application where I need to parse or tokenize XML and preserve

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.