Extract text between tags

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

canis
Posts: 9
Joined: Fri Jan 18, 2008 5:45 pm

Extract text between tags

Postby canis » Sun Mar 15, 2009 12:47 am

I have a lot of html files with similar structure:
...
<td>47:28:...numbers</td>
<td>text</td>
<td align=right>numbers</td>
...


How to extract everything between tags to different files?
At this moment I know how to extract numbers between first pair of tags:

Input
Extract lines matching [<td>47:28]
Remove HTML and XML
Remove blanks from Start of Line
Remove blanks from End of Line
Output


I can't guess how to extract text between other pairs. Can anybody help?

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Extract text between tags

Postby DataMystic Support » Mon Mar 16, 2009 9:38 pm

Use perl pattern search/replace, find

Code: Select all

<td>47:28:(.*)</td>


Action: Send var 1 to subfilter.

As a subfilter, add a Special\Secondary Output filter - directing output to the file you need.

Repeat these two steps for each section you need.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider], Majestic-12 [Bot] and 1 guest