ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Coding Snacks

[done] REQ: Removing anything before keywordA and after keywordB in .htm files

(1/1)

jity2:
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 ;)


jity2:
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

Navigation

[0] Message Index

Go to full version