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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:26:04+00:00 2026-05-16T03:26:04+00:00

I want to read data from a CFG (configuration file). How do I read

  • 0

I want to read data from a CFG (configuration file). How do I read it? Is it the same as XML?

lets say i have this text messge in text.cfg

Restaurant,tab0.png,tab0/index1.html
Shop,tab1.png,tab1/index1.html
Office,tab2.png,tab2/index1.html
Apartment,tab3.png,tab3/index1.html

now i want to parse them and create 4 dynamic button each have their own Png and open html file on click .

so whats the best way to parse them( xml or something else) ??as i want this to be generic and i have to update this data as well

  • 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-16T03:26:05+00:00Added an answer on May 16, 2026 at 3:26 am

    How is the file formatted?

    If the file is an XML document containing the configuration details then you can read it in and parse it with an XML parser the same as you do with other XML files.

    If the file is formatted differently, Eg., using comma or tab delimiters, then you’ll have to write your own code to parse the configuration details.

    There are a few options to read in a file, one of which follows:

    NSData *fileData = [[NSData alloc] initWithContentsOfFile:filePath];
    NSString *fileText = [[NSString alloc] initWithData:fileData encoding:NSUTF8StringEncoding];
    

    Don’t forget to release them when you’re done. Also this code makes some assumptions.

    • You know the file path
    • The file is using UTF8 encoding
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CLI script and want it to read data from a file.
How do I read data from a file if my file is like this
I have a simpleXml object and want to read the data from the object.I
I am new to C, and want to read some data from a file.
I want to read and write from serial using events/interrupts. Currently, I have it
I want to read line n1->n2 from file foo.c into the current buffer. I
I want to read an xml file, apply a transform, then write to another
I have xml files I want to read in and store in the database.
I want to read data from a table whose name is supplied by a
I am about to read data From a File which has stored it's time

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.