Is this possible?
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
-
- Posts: 17
- Joined: Wed Aug 30, 2006 1:26 am
Is this possible?
I am hoping I can do some sort of pattern matching with this.
I have data structured as such:
{{some tag}}date<other junk here>
I would like to have it search thousands of files (txt, asp, htm, php, etc) and when it finds {{some tag}} it counts 10 characters -past the date (the date format is 08/25/2007) then takes everything it sees after the date and removes all of it all the way to the end of the file eliminating white spaces and everything
I have data structured as such:
{{some tag}}date<other junk here>
I would like to have it search thousands of files (txt, asp, htm, php, etc) and when it finds {{some tag}} it counts 10 characters -past the date (the date format is 08/25/2007) then takes everything it sees after the date and removes all of it all the way to the end of the file eliminating white spaces and everything
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Use the EasyPattern:
Replace with
You will need to increase the maximum allowed match size (under the [...] button) to allow for the expected number of characters between the date and the end of file.
Code: Select all
[ capture( '{{some tag}}', 2 digits, '/', 2 digits, '/', 4 digits),
longest 0+ chars ;match up to end of file ]
Code: Select all
$1
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Sorry, make that:
Code: Select all
[ capture( '{{some tag}}', 2 digits, '/', 2 digits, '/', 4 digits),
longest 0+ chars ;match up to end of file
]
-
- Posts: 17
- Joined: Wed Aug 30, 2006 1:26 am
what's the difference? white spaces? carriage return? Syntax? sorry for the questions but I am trying to be more self sufficient (teach me to fish scenario here...)
Also, I tried out using some of the filters you listed in your FAQ such as remove everything from the right of a tag, remove everything to the left of a tag as well as remove everything between tags but I could not get any of them to work, no errors, just no results.
If I learned how to do these correctly, I think this program may come in very handy for me as it would help me eliminate 6 or 7 standalone tools I currently use.
Thanks!
Also, I tried out using some of the filters you listed in your FAQ such as remove everything from the right of a tag, remove everything to the left of a tag as well as remove everything between tags but I could not get any of them to work, no errors, just no results.
If I learned how to do these correctly, I think this program may come in very handy for me as it would help me eliminate 6 or 7 standalone tools I currently use.
Thanks!
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Sorry - the difference is the closing ']' is no longer in the comment started by ';' - which runs until the end of the line. I just added an extra new line.
Do you mean the FAQ on the website:
http://www.datamystic.com/textpipe/faq.html
We've updated this slightly to indicate a Perl pattern search/replace filter which was a bit vague.
Or was there another page we could update (website or help file)?
Do you mean the FAQ on the website:
http://www.datamystic.com/textpipe/faq.html
We've updated this slightly to indicate a Perl pattern search/replace filter which was a bit vague.
Or was there another page we could update (website or help file)?
-
- Posts: 17
- Joined: Wed Aug 30, 2006 1:26 am
Yes, the FAQ listed at the link you provided. The filters I am referring to are these three:
How can I search and replace within <form>...</form> tags?
How can I search and replace everything after a particular character?
How can I search and replace everything before a particular character?
Especially important would be the first one. I tried these but could not get any results. Any idea what I may be doing wrong?
How can I search and replace within <form>...</form> tags?
How can I search and replace everything after a particular character?
How can I search and replace everything before a particular character?
Especially important would be the first one. I tried these but could not get any results. Any idea what I may be doing wrong?
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
We've updated this again, to:
If you want to search and replace inside <form> elements, use Filters\Restrict\HTML or XML element or attribute, and select Restrict to between tags <FORM> and </FORM>. Check 'Include start and end tags' if you also want to search/replace inside the attributes of the tag as well.
Next, add a new search and replace (Filters\Replace\Find pattern (perl style)) and drag it INSIDE the original. This new search and replace acts only on the text found by the original search and replace, i.e. all the text between the FORM tags
If you want to search and replace inside <form> elements, use Filters\Restrict\HTML or XML element or attribute, and select Restrict to between tags <FORM> and </FORM>. Check 'Include start and end tags' if you also want to search/replace inside the attributes of the tag as well.
Next, add a new search and replace (Filters\Replace\Find pattern (perl style)) and drag it INSIDE the original. This new search and replace acts only on the text found by the original search and replace, i.e. all the text between the FORM tags
-
- Posts: 17
- Joined: Wed Aug 30, 2006 1:26 am
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact: