Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win32 API Command?

Status
Not open for further replies.

ryan

Programmer
Nov 13, 2000
73
US
Just wondering if anyone knew the API command, if there is one, that opens up a plan file and removes a line that matches the string you pass. All I want to do is take a standard file like:

1
2
3
4
5

and delete the number 3 and then the file would then render:

1
2
4
5

Any ideas, does an API exist for this?

Thanks,
Ryan
 
Hmmm my guess wud be NO. You may have to do it programmatically
 
No i don't think it does. That's a specific function where OS functions are more generic. If you're working with a seq text file, that shouldn't be hard to do where you open a user specified file, have the user either send a string that you match in the text file to delete or line number, then write every line in the old text file out to a new one, except the one they wanted to delete. Delete the old text file, rename the new one what the old one was and walla, your file minus that line. That would not be hard to do using either the Win SDK or MFC.
 
Hi,
Try to use fstream from STL.
Maybe it ha what you need.

#include<fsrteam>
using namespace std;
...
...
 
Hi,
Try to use fstream from STL.
Maybe it has what you need.

#include<fsrteam>
using namespace std;
...
...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top