67 238
Assignments Done
99,2%
Successfully Done
In November 2018

Answer to Question #27280 in C++ for Michael O' Callaghan

Question #27280
In C++ ,using Borland, how can you extract data such as Account Number, Name and Balance, from a text file? Then edit that data and save it back to the file? There are several lines of data in the file, so how do you find and edit the one you want?
Expert's answer
First of all you must set attributes of lines, to
determine what line it is. It can be done in many ways, but two of them is
pretty easy.


1. Ini files. http://en.wikipedia.org/wiki/INI_file


Entry of
file will be like


some_info...


Account=1247676745


Number=1558345


Name=John


More_info...


2. xml files


Entry:


<params>


<Account>


128676346


</Account>


<
Number >


1558345


</
Number >


<
Name >


John


</
Name >


Some
other data


</params>





To parse and edit such file you can opn them with read
and write mode


(http://www.cplusplus.com/doc/tutorial/files/)
using ios::in | ios::out mode.


Or use this thing for c++


http://www.codeproject.com/Articles/17353/XML-Application-Profile-Class

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions