![]() |
|
#1
|
|||
|
|||
Help with adding details to a fileHi all, I need some help with c++ .txt files, I just need a general description of how should I go about doing what I need to do...
Sample txt file: Code:
After processing it, I need to add details at the back of the records like so: Sample txt file: Code:
How do I go about doing this? |
|||
|
#2
|
|||
|
|||
Re: Help with adding details to a fileQuote:
Here's how I might approach it: Code:
Regards, Dave |
|
#3
|
|||
|
|||
Re: Help with adding details to a fileCool, I was thinking along the same lines as that, I wanted to get a second opinion in case my way was wrong.
Also, let's say my output file has to be the same name as my original input file and I do not need to keep a copy of the original input file: Step 1- Read in original file (sample.txt) Step 2- Produce file with extra details (temp.txt) Step 3- Rename temp.txt to sample.txt Is there code/way to rename temp.txt to sample.txt? I confess I do not know how to do it |
|
#4
|
|||
|
|||
Re: Help with adding details to a file |
|
#5
|
|||
|
|||
Re: Help with adding details to a fileBoy that's a very cool function!
And one last question, what code should I use if I want to completely delete a .txt file? |
|
#6
|
|||
|
|||
Re: Help with adding details to a fileQuote:
I respectfully suggest you get a book or find an on-line reference to standard C library functions. Dlp gave one possibility; here's another: http://www.cppreference.com/ Click on the link Standard C I/O There is a list of all of the functions in the standard C I/O library. Do you see "remove?" I mean, it's always OK to ask, but wouldn't you like to find out how to learn these things yourself? Regards, Dave |
|
#7
|
|||
|
|||
Re: Help with adding details to a fileI'm sorry ><, I used cplusplus.com but I couldn't find that "remove" function, I was looking out for something like "delete" or "destroy" =x
Anyhow, thanks guys |
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 08:44 |
| After execution - Error cannot locate /Skin File? | WSCH | C++ Forum | 1 | 05-Mar-2005 21:03 |
| CD burner wont burn!! | robertli55 | Computer Hardware Forum | 1 | 18-Jun-2004 11:53 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 12:28 |
| CD Buring Failed | skanth2000 | Computer Hardware Forum | 1 | 15-Nov-2003 04:52 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The