Hello, I'm new to text pipe and find this program very amazing, yet confusing.
I have html files that were converted from excel files. I have to make some adjustments, most of them was able to figure out but some are just to confusing...
Here's somethings I need to do:
Add HTML tag around the image file names from
<td>imagename.jpg</td>
to this
<td><img src="/image/Products/imagename.jpg" alt="" ></td>
I also need to get rid of these columns in the table:
<td class=xl6627352 align=right width=56 style='border-top:none;border-left:
none;width:42pt'>$Prices.XX </td>
erase these columns completely.
Please not that my knowledge in this program is very limited. Only scripts I know are HTML coding and JavaScript, nothing about Perl or anything like that. Thank you for your help and advice, it is greatly appreciated.
Adding HTML code to text
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Adding HTML code to text
1. Find perl pattern:
Replace with:
2. Find perl pattern:
Replace with nothing
Code: Select all
<td>([^\r\n]*\.jpg)</td>
Code: Select all
<td><img src="$1" alt="" ></td>
Code: Select all
<td class=xl6627352 align=right width=56 style='border-top:none;border-left:
none;width:42pt'>([\$\d\.\s]*)</td>
Re: Adding HTML code to text
Thank You Simon!
I've gotten the image tags to work perfectly, but the other one i had a little trouble with...
some of the width properties vary from file to file so i would have to use a perl script to find this:
<td class=xl6627352 align=right width=56 style='border-top:none;border-left:
none;width:42pt'>$Prices.XX </td>
Would there be a general code I can use for finding these sort of problems with perl? Or might there be any tutorials that I can read up on for this matter?
Thanks Again
I've gotten the image tags to work perfectly, but the other one i had a little trouble with...
some of the width properties vary from file to file so i would have to use a perl script to find this:
<td class=xl6627352 align=right width=56 style='border-top:none;border-left:
none;width:42pt'>$Prices.XX </td>
Would there be a general code I can use for finding these sort of problems with perl? Or might there be any tutorials that I can read up on for this matter?
Thanks Again
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Adding HTML code to text
Just use a perl pattern in TextPipe of course!
<td class=xl6627352 align=right width=(\d+) style='border-top:none;border-left:
none;width:(\d+)pt'>$Prices.XX </td>
<td class=xl6627352 align=right width=(\d+) style='border-top:none;border-left:
none;width:(\d+)pt'>$Prices.XX </td>