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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:36:47+00:00 2026-05-24T16:36:47+00:00

I’m not exactly sure if this is the correct question to be asked but

  • 0

I’m not exactly sure if this is the correct question to be asked but I will tell you what I am attempting. I have an ASCII txt file with product data in it. It does not have headers. I am looking for a way to convert this data into an XML file, however, I want it to parse through one of the txt fields to incorporate a look-up field and modify the data based on that field. Now I could use VB.NET, C# or Javascript. Example provided:

Example ASCII Data:

ACE14       1016    ACP, Inc.   Amana® Commercial Convection Express™ Combination Oven
AOC24       1016    ACP, Inc.   Amana® Commercial Microwave Oven, 2400 watts

Example XML I need based off example given (it would look up info based on ‘ACP, Inc.’)

<xml>
  <Product>
     <ProductManufacturer>ACP, Inc.</ProductManufacturer>
     <ProductCode>AMN-ACE14</ProductCode>
     <ProductTitle>Amana Commercial Convection Express Combination Oven</ProductTitle>
  </Product>
<Product>
     <ProductManufacturer>ACP, Inc.</ProductManufacturer>
     <ProductCode>AMN-AOC24</ProductCode>
     <ProductTitle>Amana Commercial Microwave Oven</ProductTitle>
  </Product>

Anyone direct me to some good samples? It would give me a good start. 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-24T16:36:48+00:00Added an answer on May 24, 2026 at 4:36 pm

    Here is one simple solution, but as I hinted in the comments, there really are a lot of ways to do this. Pick one based on your requirements (is reading different filetypes like this in slightly different formats a requirement – then go for a library).

    var lines = File.ReadAllLines("D:\\test.txt");
    var products = from line in lines
                   select new 
                   {
                        ProductManufacturer = line.Substring(0,12).Trim(),
                        ProductCode = line.Substring(12, 8).Trim(),
                        Description = line.Substring(20).Trim()
                   };              
    
    var xml = new XDocument(new XElement("xml", 
        from p in products
        select new XElement("Product",
            new XElement("ProductManufacturer", p.ProductManufacturer),
            new XElement("ProductCode", p.ProductCode),
            new XElement("Description", p.Description))));
    

    You could also consider creating a Product class, and then use XML Serialization instead of specifying the format in code. This is likely to be a good idea if you need to work with Product entities often.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I need a function that will clean a strings' special characters. I do NOT
I have some data like this: 1 2 3 4 5 9 2 6
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text

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.