simple find and deleat notepad program

Status
Not open for further replies.

hargi22

Solid State Member
Messages
20
hi, is there a way of using vb or #c to deleat lines from a notepad file
i have a long list in a txt format that contains something similar to
programs/folder/folder
16/4/04 index.html
16/4/04 home.htm

Programs/folder/otherfolder
16/5/04
ect

I want to deleat the lines with the dates on for the entire file but leave the programs/folder/folder bit in
any ideas
i know i can use find and replace in notepad but is there a way of finding on a line if theres a number deteating the entire line?
TIA
 
here a simple C++ program I wrote in about 5min

It takes information from input.txt if the line does not start with a number it put it in output.txt

the result is output.txt contains only the lines that dont start with numbers.

Code:
#include<iostream>
#include<fstream>
#include<iomanip>
#include<string>
#include<cctype>

using namespace std;

int main()
{
	ifstream Input;
	ofstream Output;
	char record[81];
	
	Input.open ("input.txt");  
	
		if(Input.fail( ))
		{ 
			cout << "error opening input file" << endl; 
		}
	
	Output.open("output.txt"); 
	
	if(Output.fail( )) 
	{	
		cout << "error opening output file"<<endl; 
		return 0; 
	} 

	Input.getline(record,81);

	while(Input)
	{
		
		if(!((record[0]>=48) && (record[0]<=57)))
		{
			Output<<record<<endl;

		}
		Input.getline(record,81);
	}

return 0;



}
 
Status
Not open for further replies.
Back
Top Bottom