RobinReumers Posted June 20, 2007 Posted June 20, 2007 Hi, I'm having a field which has file path's seperated by "return characters". I'd like to extract the actual filenames, so everything in between a "/" and a return character. Is there a function that can do this? Thanks Robin
Lee Smith Posted June 20, 2007 Posted June 20, 2007 Hi Robin, Try this in a new calculation field Right ( [color:red]Text ; Length ( [color:red]Text ) - Position ( [color:red]Text ; "/" ; 1 ; 1 ) ) Substitute your field for [color:red]Text. HTG Lee
RobinReumers Posted June 20, 2007 Author Posted June 20, 2007 Thanks, but how can I do this with different file paths, this will only work for the first one, right? Thanks
Lee Smith Posted June 20, 2007 Posted June 20, 2007 I'm confused by what you are looking for here. Is this a field in your file, then the calculation will show on each record. Are you importing records, and this is part of a larger text file? More detail on what you have now, and what you are trying to obtain will be helpful. Lee
RobinReumers Posted June 20, 2007 Author Posted June 20, 2007 Hi, It's for attachments, different attachments will be used with a "return character" in between, so I need to check for the return characters, put the different in soms sort of array (if this would be possible in FM) and then print the last characters of each line before the /, does anyone have an idea? Thanks Robin
RobinReumers Posted June 20, 2007 Author Posted June 20, 2007 And there can be as much as 10. Thanks Robin
comment Posted June 20, 2007 Posted June 20, 2007 If the number is not constant, a recursive calculation is required - so either a custom function, or a repeating calculation field, or a script. print the last characters of each line before the / I think you mean "the last characters of each line before the LAST /"?
fabriceN Posted June 20, 2007 Posted June 20, 2007 this function could be applied recusively http://www.briandunning.com/cf/674
RobinReumers Posted June 20, 2007 Author Posted June 20, 2007 If the number is not constant, a recursive calculation is required - so either a custom function, or a repeating calculation field, or a script. I think you mean "the last characters of each line before the LAST /"? Thanks guys, I actually meant after the last / The briandunning function is really nice, now I just have to check for the amount of "/"s. Robin
fabriceN Posted June 20, 2007 Posted June 20, 2007 (edited) no, you haven't use the occurrence -1 Edited June 20, 2007 by Guest
RobinReumers Posted June 20, 2007 Author Posted June 20, 2007 Oh I see, perfect, before I read your post, I already used patterncount, but yours is a lot easier. Thanks Robin
Recommended Posts
This topic is 6426 days old. Please don't post here. Open a new topic instead.
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