Page 3 of 3 FirstFirst 123
Results 21 to 22 of 22

Thread: Batch edit files

  1. #21
    Senior Member
    Join Date
    Jul 2002
    Posts
    339
    Ah, then insert this line after the [anyway?] line:
    /^...[mate].$/d

    You see, what in "holed" that doesn't exist in "hello" and "world"? I picked the fourth character, which is 'e'. Add some random characters (m, a, and t) and enclose in square brackets to make them a range of forbidden characters in 4th pos (d after the last slash is the delete command). And remember, . (dot) is represent any character (in that position).

    Fun, indeed.

    Peace always,
    <jdenny>
    Always listen to experts. They\'ll tell you what can\'t be done and why. Then go and do it. -- Robert Heinlein
    I\'m basically a very lazy person who likes to get credit for things other people actually do. -- Linus Torvalds


  2. #22
    Leftie Linux Lover the_JinX's Avatar
    Join Date
    Nov 2001
    Location
    Beverwijk Netherlands
    Posts
    2,534
    yups.. Jdenny's own Hello World (tested on slackware current)..

    Code:
    sed '
    /^[why]/!d
    /[do]$/!d
    /^..[real]..$/!d
    /^.[code,]/!d
    /^..[anyway?]..$/d
    /^...[mate].$/d
    ' /usr/share/dict/words
    hello
    world
    ASCII stupid question, get a stupid ANSI.
    When in Russia, pet a PETSCII.

    Get your ass over to SLAYRadio the best station for C64 Remixes !

Posting Permissions

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