View Single Post
Old 12-16-2015, 04:28 AM   #1
sbin
Voracious reader
sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.
 
sbin's Avatar
 
Posts: 56
Karma: 14644
Join Date: Oct 2009
Device: Kobo Aura One, Sony PRS T2, iPhone 6, Cybook Orizon, Cybook Gen3
how to assign an ID to every image

Hi guys,

to get my colophon data in order, I'm in need to assign an unique ID to every image in my ePub. Is there a quick way to do this either in Sigil or with a regular expression (I could unzip my ePub and then use Textwrangler or Oxygen)?

Situation:
Code:
<img src="somePath/random_filename.jpg" class="someClass" alt="someText" />
<img src="somePath/someother_filename.jpg" class="someClass" alt="someText" />
…
<img src="somePath/another_filename.jpg" class="someClass" alt="someText" />
Desidered result:
Code:
<img src="somePath/random_filename.jpg" class="someClass" alt="someText" id="image001" />
<img src="somePath/someother_filename.jpg" class="someClass" alt="someText" id="image002" />
…
<img src="somePath/another_filename.jpg" class="someClass" alt="someText" id="image634" />

(Since I switched to mac, I had to renounce to Powergrep, that would be able to do this in a second. How I miss it )

Last edited by sbin; 12-16-2015 at 04:31 AM.
sbin is offline   Reply With Quote