Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
please provide me solution.
My requirement is :

i need to open multiple file in a particular location like d:/xyz/ in this location multiple *.txt is there. in each .txt first line start with A. i want to change each A as a.
can any one let me provide the C++ code. code should be comapatable in unix machine.
Posted
Comments
[no name] 27-Jun-14 6:51am    
Being a member a year is more than enough to know that we are not here to write your code for you.
Peter Leow 27-Jun-14 7:00am    
Homework is not question.
KarstenK 27-Jun-14 8:29am    
"Please make my homework" questions wont teach you programming...

 
Share this answer
 
Unfortunately there is not a cross-platform (that is working on both Windows and Linux) way for enumerating all the files of a folder, you have to write both Windows and Linux specific code for that.
Once you are able to open them, for every file you have to
  1. Open it
  2. Load its content in memory
  3. Make the required modification in memory
  4. Write back the modified content to the original file (that is overwriting it)

The above steps can be done with cross-platform C++ code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900