Solved

reading text file in C++ with solaris OS

Posted on 2007-11-22
3
216 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now