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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:40:07+00:00 2026-05-25T17:40:07+00:00

I have been recently assigned a task in which I need to create a

  • 0

I have been recently assigned a task in which I need to create a program to edit files in Visual C#. The file is a sequential ASCII text file with multiple fixed character width rows, and the basic structure looks like this:

Each group is a single parameter, and there can be hundreds of these within a file. Each PA has a set number of columns, but each PA varies in column numbers. Additionally, there are some optional fields within each record, so that accounts for the extra spaces between some of the fields. Each field also has a separator of 1 space. I am unsure if I am being too thorough, but I figure the more information I give, the easier it will be for someone to help me.

Essentially, I want to create a GUI in which the user can select one a parameter mnemonic and then be able to edit any of the fields within the entire group of parameters

I have a little C# experience, but I am having trouble figuring out what would be the best way to accomplish this. My initial thinking was to parse the file into an array, search for each parameter name (maybe using regular expressions?), display all the parameter names in a browser. From there the user would be able to select which parameter they wish to edit. The program would then search the array again for the selected parameter, and then parse the records into text boxes, to allow for editing.

I am unsure if this is the most efficient way of accomplishing this, and I am somewhat stuck on how to actually parse the file to read the fields into the text boxes. I have searched many different forums for file parsing, but most of the topics I find related to comma delimited files which does not really apply to the file type I am working with. Any help would be greatly appreciated, and if you need me to elaborate on anything, please feel free to ask me. Thank for the help.

  • 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-25T17:40:08+00:00Added an answer on May 25, 2026 at 5:40 pm

    This isn’t C# advice, but more general programming advice. If I were you, I would create a class to represent each PA you have, and have them each inherit from the interface IPAObject (or something like that). That way you can treat them as subtypes of a abstract PA object.

    Then, I would make an class called PAGroup, which holds an array of IPAObject’s.

    Each individual concrete PA object class would then have fields for each parameter it has, and can be responsible for serializing itself to or deserializing itself from a stream (in your case, this stream is probably an input or output file), using C# file API’s. You could use regular expressions, but since each PA object has fixed-length lines, you might as well read the line in all at once, using ReadLine() and parse it using array operations, like you said yourself. If you go this route, my advice to you is to store offsets for each columns starting offset and length in each class object, rather than littering your code with a whole bunch of literal numbers.

    These classes would also each contain the logic for what their columns are and how to modify that data. Some of your columns seem open ended, so they would probably just be represented by strings. Others look like they come from a finite list of choices. These would probably be represented by constants, which belong to the relevant PA object class. The class would be responsible for converting the constants and other object to and from the actual ASCII representation from the file.

    This way, when you read the whole PA file, you end up with a nice hierarchical data structure that represents the structure of your file, and from a coding perspective, all of the logic is separated very nicely, which makes it very easy to maintain. This nice data structure could serve as the model in your model-view-controller architecture. Then you just need to worry about implementing the user interface for interacting with your data.

    I hope this helps.

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

Sidebar

Related Questions

I have recently been assigned a CSS & design project that's in a CakePHP
Have recently been given a project to complete which uses XML quite extensively.Am looking
I have recently been working with Python using Komodo Edit and other simpler editors
I've recently been assigned the task of updating a legacy database (previously managed by
I have recently been introduced to the new Access 2007 feature which is multivalued
I have recently been copying and moving a large number of files (~400,000). I
I am working on a Spring MVC application in which I have recently been
I've recently been assigned the task of being responsible for defining new processes and
I have recently been developing a website which relies a large part on the
I have been recently running into an issue in which my web application will

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.