1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do I remove unnecessary lines from text file?

Discussion in 'BlackHat Lounge' started by bk071, Jun 8, 2011.

  1. bk071

    bk071 Jr. Executive VIP Jr. VIP Premium Member

    Joined:
    Nov 24, 2010
    Messages:
    3,105
    Likes Received:
    7,917
    Occupation:
    I don't have a job
    Location:
    .............
    Yo

    Okay so here's a PLR article:

    Code:
    [COLOR="Red"]Title: [/COLOR]
    Are You A Computer Potato?
    [COLOR="Red"]Word Count:[/COLOR]
    353
    [COLOR="Red"]Summary:[/COLOR]
    Working at the computer for hours a day leads to just as big a rear-end spread as sitting on the couch all day watching television. But you?ve got work to do! How can you avoid the poor fitness that comes with a sit down job? 
    First, the wisest thing you can do is to schedule breaks every fifteen to twenty minutes. Walk around and do something different for a few minutes. People tend to think that the interruption of thought will hinder their work. On the contrary, folks w...
    [COLOR="Red"]Keywords:[/COLOR]
    Computer, potato, blah blah
    [COLOR="Red"]Article Body:[/COLOR]
    Working at the computer for hours a day leads to just as big a rear-end spread as sitting on the couch all day watching television. But you?ve got work to do! How can you avoid the poor fitness that comes with a sit down job? 
    First, the wisest thing you can do is to schedule breaks every fifteen to twenty minutes. Walk around and do something different for a few minutes. People tend to think that the interruption of thought will hinder their work. On the contrary, folks who actually take these breaks insist that they have twice as much energy and get nearly quadruple the amount of work done each day. 
    Why? The brain refreshes, sort of like your webpage does. When you come back to a task after a break, you?re more refreshed and ready to tackle your current project. If you have a laptop, that?s even better. Take it to a different room every hour and a half. Watch how your overall energy increases as you change scenery once in a while! 
    During the wait time on your computer ? there?s so much of this ? you can do a few stretches. While your page is loading, try these neck exercises to reduce strain and stress in this area. 
    Slowly, turn your head to the right as far as you can. Hold this position for fifteen seconds. Then repeat for the left side. When you get up for a break, stop at the door frame of your office. Hold your arms in the ?hold up? position ? as if Jesse James were robbing you and you had your hands in the air (bent at the elbows). Then place the inside of your arms and your palms on each side of the door frame and lean in slowly. Hold the stretch for twenty seconds. 
    These little stretches can literally save you much stress. Many computer workers end up with a stiff neck or arm and hand pain. Taking frequent breaks and getting in the habit of stretching when you have downtime can lessen the possibility for problems in the future.
    
    What I want to do is remove the summary, wordcount, and keywords...

    Anyone got an idea of how to do it?

    I want it to look like this:
    Code:
    [COLOR="Red"]Title:[/COLOR] 
    Are You A Computer Potato?
    [COLOR="Red"]Article Body:[/COLOR]
    Working at the computer for hours a day leads to just as big a rear-end spread as sitting on the couch all day watching television. But you?ve got work to do! How can you avoid the poor fitness that comes with a sit down job? 
    First, the wisest thing you can do is to schedule breaks every fifteen to twenty minutes. Walk around and do something different for a few minutes. People tend to think that the interruption of thought will hinder their work. On the contrary, folks who actually take these breaks insist that they have twice as much energy and get nearly quadruple the amount of work done each day. 
    Why? The brain refreshes, sort of like your webpage does. When you come back to a task after a break, you?re more refreshed and ready to tackle your current project. If you have a laptop, that?s even better. Take it to a different room every hour and a half. Watch how your overall energy increases as you change scenery once in a while! 
    During the wait time on your computer ? there?s so much of this ? you can do a few stretches. While your page is loading, try these neck exercises to reduce strain and stress in this area. 
    Slowly, turn your head to the right as far as you can. Hold this position for fifteen seconds. Then repeat for the left side. When you get up for a break, stop at the door frame of your office. Hold your arms in the ?hold up? position ? as if Jesse James were robbing you and you had your hands in the air (bent at the elbows). Then place the inside of your arms and your palms on each side of the door frame and lean in slowly. Hold the stretch for twenty seconds. 
    These little stretches can literally save you much stress. Many computer workers end up with a stiff neck or arm and hand pain. Taking frequent breaks and getting in the habit of stretching when you have downtime can lessen the possibility for problems in the future.
    
    Anyone? Thanks and reps await ;)
     
    Last edited: Jun 8, 2011
  2. dryheat360

    dryheat360 Regular Member

    Joined:
    Dec 30, 2009
    Messages:
    294
    Likes Received:
    211
    I dont understand? You already posted the final product that you wanted...

    Its a simple copy and paste. Copy what you want and paste it into a textpad or word processor, then delete what you dont want. Better yet, copy ONLY the part you want and paste it into notepad.

    I must be missing something... you cant really be asking this question lol..
     
  3. BigLarry

    BigLarry Regular Member

    Joined:
    Mar 2, 2011
    Messages:
    218
    Likes Received:
    144
    If you have shell access you could upload them all to your server and do

    Code:
    sed -i "1,5 d" *.txt
    (Obviously when you're in the directory containing the PLR).
     
  4. bk071

    bk071 Jr. Executive VIP Jr. VIP Premium Member

    Joined:
    Nov 24, 2010
    Messages:
    3,105
    Likes Received:
    7,917
    Occupation:
    I don't have a job
    Location:
    .............
    That was just an example lol... There are thousands of articles that need to be manipulated so doing this manually is not an option.
     
  5. jamesyboy

    jamesyboy Regular Member

    Joined:
    Apr 4, 2011
    Messages:
    213
    Likes Received:
    21
    You could import them all into a database or spreadsheet then remove the fields you don't require and export them.