Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 10, 2016, 11:55:44 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: [done] REQ: Removing anything before keywordA and after keywordB in .htm files  (Read 1582 times)

jity2

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 98
    • View Profile
    • Donate to Member
Hello,

I have many htm files in a folder.
I would like that an Autohotkey script opens one file, then delete anything before keyword A and after keyword B. Then save and close the htm file.
And repeat the same process for all the other htm files in the folder.

note: Keyword A & B can be a long phrase like "var this_is<_a long: "phrase" "

Thanks by advance ;)


« Last Edit: March 16, 2014, 04:35:19 AM by jity2 »

jity2

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 98
    • View Profile
    • Donate to Member
Hello,

In case this helps : I have found a way to do that with this freeware : DNgrep
http://code.google.com/p/dngrep/

I select the folder where the htm files are located. Then I click on the right icon and I write "*.htm".

Here are the regex :

1) cut everything after keyword2 :
with regex +multiline + dot as newline checked
replace
keyword2.*
with
nothing
+ hit search then hit replace

2) cut anything before keyword1 :
with regex +multiline + dot as newline checked
replace
.*?keyword1
with
nothing
+ hit search then hit replace

voila ! ;)
see ya