Newbies Jerry Ross Posted November 23, 2004 Newbies Posted November 23, 2004 Hi all, I'm new to programming FM and need some assistance with parsing my image paths. I have a Container field (Colorway Image) with an image placed in it. I also created a calculated field using GetAsText(Colorway Image). This field returns the value: size:504,445 image:Images/103456_comp.tif imagemac:/Radiance/Users/jerryross/Documents/Project Files/TMaG/Footwear Supplement SS05/Images/103456_comp.tif What I need help with is extracting the image name and location. Everything after "imagemac:" The purpose of this is it to export the data in Tab Delimited format and then in turn inport the data into an InDesign template. An input on the syntax needed to parse this would be great. thanks, JR
Wim Decorte Posted November 24, 2004 Posted November 24, 2004 Define two calc fields: (source = the field that has the result of the GetAsText function). I've uploaded the demo file... Check the FM help file for the functions that are being used: - MiddleValues: because GetAsText gives you a return delimited list. We want to work only with the last item in that list - Position: gives you the position number of a character in the text string - Patterncount: gives you the # of occurences of a charachter - Middle and right: to extract a certain sub-string from the source string -------------------------------------- Path = Let( theSource = RightValues( source; 1 ); Middle( thesource; Position( thesource; ":"; 1; 1 ) + 1; ( Position( thesource; "/"; 1; PatternCount( thesource; "/" ) ) + 1 ) - Position( thesource; "/"; 1; 1 ) ) ) -------------------------------- Filename = Let( theSource = Substitute( RightValues( source; 1 ); " ExtractPathImage.zip
Wim Decorte Posted November 24, 2004 Posted November 24, 2004 And by the way: the calculations are formatted through http://www.aptworks.com/bin/calc_formatter_2v0.cgi to make them somewhat readable. Thanks to Debi for this great tool.
Newbies Jerry Ross Posted November 30, 2004 Author Newbies Posted November 30, 2004 Thanks! This formula works great. I would have taken me hours to figure that out. jr
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now