Pre and post line addition

2011-09-25
2012-11-14
  • Mike Watson
    Mike Watson
    2011-09-25

    Hi I have a file of blacklists, inside the file it looks like this
    82.196.4.19/heberg
    82.196.4.22/heberg
    82.196.4.23/heberg
    ab.qcm.cz/ad
    actionscript.org/ads/
    actionsplash.com/site

    I would like to use the regex function to add           "add dst-host=" to the start of each line and "  action=deny"
    to the end of the file so the results will look like this

    I would do this by hand but there are a million lines ;)

    thanks
    add dst-host=yukoyuko.112.2o7.net action=deny
    add dst-host=yuppads.com action=deny
    add dst-host=yuppitraffic.info action=deny
    add dst-host=yuzt.com action=deny
    add dst-host=z.abnad.net action=deny
    add dst-host=z.blogads.com action=deny
    add dst-host=z.digg.com action=deny
    add dst-host=z.extreme-dm.com action=deny
    add dst-host=z0.extreme-dm.com action=deny

     

  • Anonymous
    2011-09-27

    Use two replace commands :-

    find what:^
    replace with:add dst-host=

    and

    find what:$
    replace with: action=deny

    Make sure Regular expression is selected.