Alan, Thank you so much for your speedy response. The images are in different places I'll try the second option as you suggest. I don't understand the specific meanings of (.*?) $1 and [^":]+):? with ?$1/? Is there a reference/source where I can learn more about searches and what those expressions mean? Best regards, James
On Friday, October 06, 2006, at 10:15AM, Allan Odgaard throw-away-1@macromates.com wrote:
On 6. Oct 2006, at 18:43, thelittleredhen@mac.com wrote:
I have an xml file that contains numerous image paths in this format <Pic_path href="HD2:Working Files:images:testpic.jpg"/>
I need to convert them to this format <Pic_path href="file:/// Volumes/HD2/Working Files/images/testpic.jpg"/>
Is there any way I can get TM to search for the paths and convert the text?
If all the images are in the same location, you can enable Regular Expressions, then search for: ?<Pic_path href="HD2:Working Files:images:(.*?)"/>? and replace with: ?<Pic_path href="file:/// Volumes/HD2/Working Files/images/$1"/>?.
If however they vary in path, you will need to first do a replace from: ?<Pic_path href="HD2:? to ?<Pic_path href="file:///Volumes/HD2/?.
Then repeat a (regular expression) replace of: ?(<Pic_path href="file:///Volumes/HD2/[^":]+):? with ?$1/? until no replacements are done.
Do a backup first!
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Oct 6, 2006, at 3:11 PM, James Mooney wrote:
Is there a reference/source where I can learn more about searches and what those expressions mean?
There's a chapter on them in the TextMate book:
http://www.pragmaticprogrammer.com/titles/textmate/index.html
James Edward Gray II
Thanks Fred and James Edward Gray II
Those are Regular Expressions. You can start here[1]
[1]http://macromates.com/textmate/manual/regular_expressions#regular_express ions
There's a chapter on them in the TextMate book:
http://www.pragmaticprogrammer.com/titles/textmate/index.html
Apologies for all the duplicate postings James