Results 1 to 4 of 4

Thread: Problem with sed

  1. #1
    Join Date
    Nov 2009
    Posts
    343

    Problem with sed

    Hello,
    I have to delete a file any line excepting the lines between x and y. So I use
    Code:
    sed '15, 30 "d '
    but I saw that this retrieves the rows in a variable I can use this solution. If someone has a solution to solve my problem, it will be highly appreciated.
    Thank you in advance

  2. #2
    Join Date
    Apr 2008
    Posts
    264

    Re: Problem with sed

    Hi
    Code:
    but I saw that retrieves the rows in a variable I can use this solution.
    With an overview of your code, it would be much more clearer for understanding. Possibly incremented a variable to count the number of rows processed. Please post your complete code and highlight the problem.

  3. #3
    Join Date
    Nov 2009
    Posts
    343

    Re: Problem with sed

    Hello
    I have posted my code below
    Here I retrieves the Max line
    mal = $ (grep-n '0000aaaa '$ (i). Tsim.log | sed "s, \:; \ g" | gawk' (print $ 1) '| sed' $! D ')
    Here I retrieves the Min line
    Code:
    mil = $ (grep-n 'Tsim> mem' $ (i). Tsim.log | sed "s, \:; \ g")
    Then I would delete the entire line that is not in this interval but I do not find a way with sed.
    Code:
    sed '15, 41 "d '$ (i). tsim.log>> $ () BIN_ROM / Plan.txt
    Amassing replace my 15 and 41 by my Maxline and Minlin variables if possible. All this his is in a loop.

  4. #4
    Join Date
    Apr 2008
    Posts
    264

    Re: Problem with sed

    Hello
    I just tested the code and it works fine
    Code:
    / bin / sh
    sed $ 1, $ 2 \! d / etc / rc.d / rc.sysinit
    exit 0
    We must understand that the shell does not evaluate a variable if it is in single quotes. He estimated that if there is anything or quotes.

Similar Threads

  1. Sony VGNCS3 laptop 15 inch screen problem...LCD or CHIP problem?
    By Mick$Tyler in forum Hardware Peripherals
    Replies: 5
    Last Post: 31-10-2010, 06:49 AM
  2. Replies: 6
    Last Post: 27-07-2010, 12:10 AM
  3. hard disk problem, clicking sound and windows problem
    By rajat_2589 in forum Hardware Peripherals
    Replies: 1
    Last Post: 16-06-2010, 11:34 PM
  4. Replies: 4
    Last Post: 10-04-2010, 04:19 PM
  5. Replies: 1
    Last Post: 30-11-2004, 11:57 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,476,736.41860 seconds with 17 queries