Solved

reading text file in C++ with solaris OS

Posted on 2007-11-22
3
218 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
3 Comments
 
LVL 3

Accepted Solution

by:
humergu earned 50 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

740 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