Open it in Word and do a "Find and Replace" with a blank?

I have a txt file with lots and lots of lines of text.
I need a program that can sweep through the file, line by line, and delete every line that has a certain string in it.
I can write this in C, but I don't remember how to deal with files. And frankly, I don't want to remember.
Anyone?
"Beware of he who would deny you access to information, for in his heart he dreams himself your master" - Commissioner Pravin Lal.

Open it in Word and do a "Find and Replace" with a blank?
Blog: www.kennethlim.net // Twitter: @kennethlim
Jon Miller-
I AM.CANADIAN
GENERATION 35: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

It's been 30 minutes since the post - really, you could've easily written a program to do it by now.
Solver, WePlayCiv Co-Administrator
Contact: solver-at-weplayciv-dot-com
I can kill you whenever I please... but not today. - The Cigarette Smoking Man

I actually started doing that but I have an ancient C compiler that gave me too many weird errors unconnected to the code. Screw it.
JM:
I'd rather write code in a language I know.![]()
"Beware of he who would deny you access to information, for in his heart he dreams himself your master" - Commissioner Pravin Lal.

HTF do I read until EOL (not EOF) in C?
"Beware of he who would deny you access to information, for in his heart he dreams himself your master" - Commissioner Pravin Lal.

I have achieved victory over the evil compiler.![]()
"Beware of he who would deny you access to information, for in his heart he dreams himself your master" - Commissioner Pravin Lal.

Learned a lot about C++ too.
"Beware of he who would deny you access to information, for in his heart he dreams himself your master" - Commissioner Pravin Lal.

Regular expressions![]()
I came upon a barroom full of bad Salon pictures in which men with hats on the backs of their heads were wolfing food from a counter. It was the institution of the "free lunch" I had struck. You paid for a drink and got as much as you wanted to eat. For something less than a rupee a day a man can feed himself sumptuously in San Francisco, even though he be a bankrupt. Remember this if ever you are stranded in these parts. ~ Rudyard Kipling, 1891
DanS knows regex? WTF?![]()

The '\n' character indicates the carriage return, as far as I'm aware.Originally posted by Eli
HTF do I read until EOL (not EOF) in C?

Thanks aneeshm, I already written the program.
I just used getline to avoid the EOL hassle. It's all very simple once you find a page on the internet with a list of all the commands.![]()
"Beware of he who would deny you access to information, for in his heart he dreams himself your master" - Commissioner Pravin Lal.
If it works, great. If it doesn't, scream. I've done some C programming so maybe I can help.
What VetLegion means is that he's done some butt massages.
In da butt.
"Do not worry if others do not understand you. Instead worry if you do not understand others." - Confucius
THE UNDEFEATED SUPERCITIZEN w:4 t:2 l:1 (DON'T ASK!)
"God is dead" - Nietzsche. "Nietzsche is dead" - God.

It works. The hard part was figuring out what functions I have at my service. The algorithm itself is trivial. I just had to run it a number of times, killing all the variations (capital letters and stuff).
"Beware of he who would deny you access to information, for in his heart he dreams himself your master" - Commissioner Pravin Lal.
What VetLegion means is that he's done some butt massages.
Is that how you write code in the Former Swedish Province of Finland?
No. Our programming is usually world class. We don't do butt massages then. In Finland, only gay people and bi-sexuals do that. I don't know how it is in Croatia, but I think we are kind of sticking with the definition. I know! Silly us... so Lutheran. Do what the book says.... follow the rules. I guess you liberal Croats have taken another approach.
I guess you guys go like, "Dobro jutro! Can I butt massage you because it is such a fine day!?".
In da butt.
"Do not worry if others do not understand you. Instead worry if you do not understand others." - Confucius
THE UNDEFEATED SUPERCITIZEN w:4 t:2 l:1 (DON'T ASK!)
"God is dead" - Nietzsche. "Nietzsche is dead" - God.

If you are running unix/linux, try using egrep -v next time (or get a unix tool package for windows).
With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion.
Steven Weinberg
No, it goes:Originally posted by Pekka
I guess you guys go like, "Dobro jutro! Can I butt massage you because it is such a fine day!?".
"Dobro jutro! Mogu li ti izmasirati guzicu jer je tako lijep dan?"
We don't mix English with Croatian when we speak![]()
No wait. Doesn't that really mean, "Yes, I packed my bags and never left them unintended" ??
In da butt.
"Do not worry if others do not understand you. Instead worry if you do not understand others." - Confucius
THE UNDEFEATED SUPERCITIZEN w:4 t:2 l:1 (DON'T ASK!)
"God is dead" - Nietzsche. "Nietzsche is dead" - God.
No. Our programming is usually world class.
I doubt it, I doubt it. I didn't hear of anything good coming from Finland since Linus T., which was like 50 years ago. I think even Estonia has Finland beat in the hi-tech world (Skype, etc...).
Any why is that? Because Finland is finlandized and you don't dare do anything until you ask the Russians![]()
Unintended? I bet that sentence makes sense in Finnish and in Russian, but it doesn't in English nor Croatian.Originally posted by Pekka
Doesn't that really mean, "Yes, I packed my bags and never left them unintended" ??
I meant attended... well anyway. I don't mind making few mistakes. At least I'm not the one on the bottom bunk.
In da butt.
"Do not worry if others do not understand you. Instead worry if you do not understand others." - Confucius
THE UNDEFEATED SUPERCITIZEN w:4 t:2 l:1 (DON'T ASK!)
"God is dead" - Nietzsche. "Nietzsche is dead" - God.
Finland - a nation of Putin's butlers![]()
You know that won't work. It's just too obvious VL... I'd expect a real effort from you![]()
In da butt.
"Do not worry if others do not understand you. Instead worry if you do not understand others." - Confucius
THE UNDEFEATED SUPERCITIZEN w:4 t:2 l:1 (DON'T ASK!)
"God is dead" - Nietzsche. "Nietzsche is dead" - God.
Is that the phone ringing Pekka? Shouldn't you answer? Maybe the Russian embassy needs a pizza?![]()
Dude, you just don't know what makes me tick. It's not Russian things, it's not suggestions about sexuality, none of that stuff really bothers me.
Things that tick me off have never been discovered here...![]()
In da butt.
"Do not worry if others do not understand you. Instead worry if you do not understand others." - Confucius
THE UNDEFEATED SUPERCITIZEN w:4 t:2 l:1 (DON'T ASK!)
"God is dead" - Nietzsche. "Nietzsche is dead" - God.
I think you overestimate yourself. One's character, fears and phobias can be pretty well deduced from his posts.
Especially if he keeps us up to date about them with dozens of threads, like you do![]()
![]()
I think you need a hug. Lately, you've been trying to get me going on, making thread about Foucault and all this stuff. It doesn't bother me VL, in my eyes, you're just a lost puppy looking for love.
In da butt.
"Do not worry if others do not understand you. Instead worry if you do not understand others." - Confucius
THE UNDEFEATED SUPERCITIZEN w:4 t:2 l:1 (DON'T ASK!)
"God is dead" - Nietzsche. "Nietzsche is dead" - God.
Foucault
New Age in general and New Ageist Pekka in particular
Deepak Chopra
Puppies looking for love![]()
(I'm undecided)
Bookmarks