Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

reading text file in C++ with solaris OS

Posted on 2007-11-22
3
Medium Priority
?
222 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
2 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Screencast - Getting to Know the Pipeline
Suggested Courses

876 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