Find the answer to your Linux question:
Results 1 to 4 of 4
Hi all i really hate to have to post a topic on this but i have been trying to get this script to work for a week now and cant ...
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    3

    sed just cant get it to copy between expressions

    Hi all i really hate to have to post a topic on this but i have been trying to get this script to work for a week now and cant seem to get it to work so i guess its time for me to ask for help

    im trying to get sed to read through a txt document that contains html and cant get it to copy over my code looks like
    Code:
    sed -n '/[width=468 height=60 border=0 /></a></center><hr>]/,/[<br clear=left><hr>]/p' 1.txt > 2.txt
    This is the code that seemed to have the best chance of working but still all it does is copy the whole txt document over instead of between these 2 expressions

    any help would be greatly appreciated

  2. #2
    Just Joined!
    Join Date
    Apr 2010
    Posts
    3
    bump well i tried to change it around as much as i can but i can only either get it to ouput no information(blank 2.txt) or all the information. Still quite stumped on this and now seeing if i can have any luck in gawk

  3. #3
    Just Joined!
    Join Date
    Apr 2010
    Posts
    3
    well im at a dead end nothing i do seems to work to bad im talking to myself over here

  4. #4
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    probably you are having difficulty because of all the / inside of your sed statement, you should use something different to separate the parts, like |

    it is difficult to see what you are trying to do

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...