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!

Deleting parts of text file

Status
Not open for further replies.

hedvule

Programmer
Oct 25, 2004
7
CH
I have a following problem:
I have a text file, I have to read each row and if it fullfills some conditions delete this line. The file looks like this:
1234 472 890
278 9009 12.348
etc.

I have to check e.g. 1234+472+890 > 7899 ?
If yes, delete this line! Is it possible within this file or is it better to write a new file just with "good" lines?

Thanks, Hedvule.
 
> Is it possible within this file
Well you could rewrite the line to just contain spaces....

> or is it better to write a new file just with "good" lines?
That's probably the more usual way of doing it.

BTW, this can be done usign a 1-line 'AWK' program :)

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top