Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

reading text file in C++ with solaris OS

Posted on 2007-11-22
3
Medium Priority
?
221 Views
Last Modified: 2010-04-24
Hi,

I have a text file & it is having content as
2|50000|1000|S|Abc|0
I would like to read the above file and assign values to six variables: integer and string.

Here, I am using C++ and solaris is the Operating system.
Please tell me like how to do that in C++?

thanks,
shankarraj
0
Comment
Question by:shankarraj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Accepted Solution

by:
humergu earned 200 total points
ID: 20399600
the file is in the csv (comma separated value) file format with "|" as delimiter.

a quick google search gave me the following results (took a brief view to filter out...):

http://www.codeproject.com/KB/cpp/Simple_CSV_Parser_class.aspx
http://www.linuxquestions.org/questions/programming-9/c-read-csv-file-row-into-vector-250978/

hope it helps!
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20591114
Forced accept.

Computer101
EE Admin
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question