Extract data from txt to csv file

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

gazdovsky
Posts: 2
Joined: Tue Nov 19, 2013 8:34 pm

Extract data from txt to csv file

Postby gazdovsky » Tue Nov 19, 2013 9:20 pm

Hello, I have about 800 txt files with html code.
There are next fragments:
1. I need: 440628-12 and 359.99
var DefaultVAT="$0.00";

var DefaultSku="440628-12";
var DefaultWeight1=4;
var DefaultWeight2=0;
var DefaultPrice="$359.99";
2. I need: 440585_38_FT-dtl.jpg
<td width="33%" class="pcShowAdditionalImage">

<a href="catalog/440585_38_FT-dtl.jpg" class="highslide" onclick="return hs.expand(this, { slideshowGroup: 'slides' })" id="1"><img id="440585_38_FT-dtl.jpg" onmouseover='javascript:window.document.mainimg.src="catalog/440585_38_FT.jpg";linkChanger( "440585_38_FT-dtl.jpg" )' src='catalog/440585_38_FT.jpg' alt="Ski-Doo 2014 Ladies Absolute 0 Jacket - Ice" /></a>

<div class="highslide-caption">Ski-Doo 2014 Ladies Absolute 0 Jacket - Ice</div>
3. I need: Ladies’ version of the jacket worn by Nicolas Musters when he set his guinness world record. A jacket without compromise. It will keep any rider warm in arctic colds while providing a removable liner and ultimate breathability when temperatures become milder. Extremely warm, durable, breathable and reliable. Performance is guaranteed to last season after season. <br /> Sympatex 2-Ply Laminated Polyester <br /> Primaloft One

<!-- Start long product description -->

<table class="pcShowContent">
<tr>
<td><a name="details">&nbsp;</a></td>
</tr>
<tr>
<td class="pcSectionTitle">
Product Details
</td>
</tr>
<tr>
<td style="padding:8px;">
Ladies’ version of the jacket worn by Nicolas Musters when he set his guinness world record. A jacket without compromise. It will keep any rider warm in arctic colds while providing a removable liner and ultimate breathability when temperatures become milder. Extremely warm, durable, breathable and reliable. Performance is guaranteed to last season after season. <br /> Sympatex 2-Ply Laminated Polyester <br /> Primaloft One
</td>
</tr>
<tr>
<td>
<div align='right'><a href='#top'>Back to the top</a></div>
</td>
</tr>
</table>
<!-- End long product description -->

In attachment example of file. Thank you in advance for your help!

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

Re: Extract data from txt to csv file

Postby DataMystic Support » Thu Dec 12, 2013 12:26 pm

1. Use an EasyPattern:

var DefaultVAT="[ capture( 1+not cr or lf or <"> ) as 'DefaultVAT' ]";

var DefaultSku="[ capture( 1+not cr or lf or <"> ) as 'DefaultSku' ]";
var DefaultWeight1=[ capture( 1+not cr or lf or <;> ) as 'DefaultWeight1' ];
var DefaultWeight2=[ capture( 1+not cr or lf or <;> ) as 'DefaultWeight2' ];
var DefaultPrice="[ capture( 1+not cr or lf or <"> ) as 'DefaultPrice' ]";

Replace with:
@DefaultVAT@, @DefaultSku@, etc

2. Use an EasyPattern:

<a href="catalog/[ capture(1+ chars ) as 'filename' ]" class="highslide"

Replace with

@filename@

and check 'Extract '
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] and 1 guest