Page 1 of 2 1 2 LastLast
Results 1 to 30 of 45

Thread: I Need a Program that can do ...

  1. #1
    Eli
    Emperor Eli's Avatar
    Join Date
    02 Jul 2000
    Location
    Israel
    Posts
    6,480
    Country
    This is Eli's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    19:46

    I Need a Program that can do ...

    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.

  2. #2
    Zopperoni
    Emperor Zopperoni's Avatar
    Join Date
    27 Dec 2000
    Posts
    5,155
    Country
    This is Zopperoni's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    18:46
    Open it in Word and do a "Find and Replace" with a blank?

  3. #3
    Jon Miller
    OTF Moderator Jon Miller's Avatar
    Join Date
    18 May 1999
    Posts
    17,201
    Thanks
    70
    Thanked 11 Times in 9 Posts
    Local Date
    May 22, 2013
    Local Time
    12:46
    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.

  4. #4
    Solver
    Deity Solver's Avatar
    Join Date
    24 Sep 2000
    Location
    Latvia, Riga
    Posts
    18,354
    Country
    This is Solver's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    20:46
    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

  5. #5
    Eli
    Emperor Eli's Avatar
    Join Date
    02 Jul 2000
    Location
    Israel
    Posts
    6,480
    Country
    This is Eli's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    19:46
    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.

  6. #6
    Eli
    Emperor Eli's Avatar
    Join Date
    02 Jul 2000
    Location
    Israel
    Posts
    6,480
    Country
    This is Eli's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    19:46
    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.

  7. #7
    Eli
    Emperor Eli's Avatar
    Join Date
    02 Jul 2000
    Location
    Israel
    Posts
    6,480
    Country
    This is Eli's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    19:46
    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.

  8. #8
    Eli
    Emperor Eli's Avatar
    Join Date
    02 Jul 2000
    Location
    Israel
    Posts
    6,480
    Country
    This is Eli's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    19:46
    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.

  9. #9
    DanS
    Deity DanS's Avatar
    Join Date
    31 Dec 1969
    Location
    Not your daddy's Benjamins
    Posts
    15,334
    Country
    This is DanS's Country Flag
    Thanks
    9
    Thanked 1 Time in 1 Post
    Local Date
    May 22, 2013
    Local Time
    13:46
    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

  10. #10
    Kuciwalker
    Deity Kuciwalker's Avatar
    Join Date
    17 Feb 2001
    Posts
    19,361
    Thanks
    5
    Thanked 16 Times in 12 Posts
    Local Date
    May 22, 2013
    Local Time
    13:46
    DanS knows regex? WTF?

  11. #11
    aneeshm
    King aneeshm's Avatar
    Join Date
    01 Jul 2001
    Location
    Pune , Maharshtra
    Posts
    2,880
    Country
    This is aneeshm's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    23:16
    Originally posted by Eli
    HTF do I read until EOL (not EOF) in C?
    The '\n' character indicates the carriage return, as far as I'm aware.

  12. #12
    Eli
    Emperor Eli's Avatar
    Join Date
    02 Jul 2000
    Location
    Israel
    Posts
    6,480
    Country
    This is Eli's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    19:46
    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.

  13. #13
    VetLegion
    Emperor VetLegion's Avatar
    Join Date
    24 Sep 1999
    Posts
    4,332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    18:46
    If it works, great. If it doesn't, scream. I've done some C programming so maybe I can help.

  14. #14
    Pekka
    Emperor Pekka's Avatar
    Join Date
    12 Feb 2002
    Location
    Xrr ZRRRRRRR!!
    Posts
    6,787
    Thanks
    0
    Thanked 3 Times in 1 Post
    Local Date
    May 22, 2013
    Local Time
    20:46
    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.

  15. #15
    Eli
    Emperor Eli's Avatar
    Join Date
    02 Jul 2000
    Location
    Israel
    Posts
    6,480
    Country
    This is Eli's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    19:46
    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.

  16. #16
    VetLegion
    Emperor VetLegion's Avatar
    Join Date
    24 Sep 1999
    Posts
    4,332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    18:46
    What VetLegion means is that he's done some butt massages.


    Is that how you write code in the Former Swedish Province of Finland?

  17. #17
    Pekka
    Emperor Pekka's Avatar
    Join Date
    12 Feb 2002
    Location
    Xrr ZRRRRRRR!!
    Posts
    6,787
    Thanks
    0
    Thanked 3 Times in 1 Post
    Local Date
    May 22, 2013
    Local Time
    20:46
    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.

  18. #18
    BlackCat
    Emperor
    Join Date
    29 Jul 2004
    Posts
    9,096
    Country
    This is BlackCat's Country Flag
    Thanks
    4
    Thanked 7 Times in 7 Posts
    Local Date
    May 22, 2013
    Local Time
    19:46
    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

  19. #19
    VetLegion
    Emperor VetLegion's Avatar
    Join Date
    24 Sep 1999
    Posts
    4,332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    18:46
    Originally posted by Pekka
    I guess you guys go like, "Dobro jutro! Can I butt massage you because it is such a fine day!?".
    No, it goes:

    "Dobro jutro! Mogu li ti izmasirati guzicu jer je tako lijep dan?"

    We don't mix English with Croatian when we speak

  20. #20
    Pekka
    Emperor Pekka's Avatar
    Join Date
    12 Feb 2002
    Location
    Xrr ZRRRRRRR!!
    Posts
    6,787
    Thanks
    0
    Thanked 3 Times in 1 Post
    Local Date
    May 22, 2013
    Local Time
    20:46
    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.

  21. #21
    VetLegion
    Emperor VetLegion's Avatar
    Join Date
    24 Sep 1999
    Posts
    4,332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    18:46
    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

  22. #22
    VetLegion
    Emperor VetLegion's Avatar
    Join Date
    24 Sep 1999
    Posts
    4,332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    18:46
    Originally posted by Pekka
    Doesn't that really mean, "Yes, I packed my bags and never left them unintended" ??
    Unintended? I bet that sentence makes sense in Finnish and in Russian, but it doesn't in English nor Croatian.

  23. #23
    Pekka
    Emperor Pekka's Avatar
    Join Date
    12 Feb 2002
    Location
    Xrr ZRRRRRRR!!
    Posts
    6,787
    Thanks
    0
    Thanked 3 Times in 1 Post
    Local Date
    May 22, 2013
    Local Time
    20:46
    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.

  24. #24
    VetLegion
    Emperor VetLegion's Avatar
    Join Date
    24 Sep 1999
    Posts
    4,332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    18:46
    Finland - a nation of Putin's butlers

  25. #25
    Pekka
    Emperor Pekka's Avatar
    Join Date
    12 Feb 2002
    Location
    Xrr ZRRRRRRR!!
    Posts
    6,787
    Thanks
    0
    Thanked 3 Times in 1 Post
    Local Date
    May 22, 2013
    Local Time
    20:46
    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.

  26. #26
    VetLegion
    Emperor VetLegion's Avatar
    Join Date
    24 Sep 1999
    Posts
    4,332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    18:46
    Is that the phone ringing Pekka? Shouldn't you answer? Maybe the Russian embassy needs a pizza?

  27. #27
    Pekka
    Emperor Pekka's Avatar
    Join Date
    12 Feb 2002
    Location
    Xrr ZRRRRRRR!!
    Posts
    6,787
    Thanks
    0
    Thanked 3 Times in 1 Post
    Local Date
    May 22, 2013
    Local Time
    20:46
    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.

  28. #28
    VetLegion
    Emperor VetLegion's Avatar
    Join Date
    24 Sep 1999
    Posts
    4,332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    18:46
    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

  29. #29
    Pekka
    Emperor Pekka's Avatar
    Join Date
    12 Feb 2002
    Location
    Xrr ZRRRRRRR!!
    Posts
    6,787
    Thanks
    0
    Thanked 3 Times in 1 Post
    Local Date
    May 22, 2013
    Local Time
    20:46
    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.

  30. #30
    VetLegion
    Emperor VetLegion's Avatar
    Join Date
    24 Sep 1999
    Posts
    4,332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 22, 2013
    Local Time
    18:46
    Foucault

    New Age in general and New Ageist Pekka in particular

    Deepak Chopra

    Puppies looking for love (I'm undecided)

Page 1 of 2 1 2 LastLast

Similar Threads

  1. I Need a Program that can do ...
    By Eli in forum Off Topic
    Replies: 44
    Last Post: May 30, 2007, 18:36
  2. help with a C program (very basic).
    By Kaak in forum Off-Topic-Archive
    Replies: 22
    Last Post: January 29, 2003, 10:28
  3. Which program to use?
    By GePap in forum Scenario League / Civ2-Creation -Archive
    Replies: 10
    Last Post: November 17, 2002, 08:34

Visitors found this page by searching for:

i need a program that

need a program that can

Bookmarks

Posting Permissions