The following will work if the filenames are a fixed length. I am assuming 8 
characters.
=MID(CELL("filename");FIND(".";CELL("filename"))-8;8)

If the length is variable then you could include another find() for the 
slash and a right() to remove it and preceding characters but this will make 
it much more complicated. Maybe do the second parse in another cell.


-- 
Dennis

Disclaimer: The above is my opinion. I do not guarantee it. Be sure to back 
up any files involved and use at your own risk. Batteries not included. Not 
for internal use. Don't run with knives.

"James E. Lang" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I want to display the filename within a CALC document. I do not want to 
>include
> the path or the filename extension.
>
> I have only been able to find one way to obtain the name of the CALC 
> document
> file using standard functions. That is 'cell("filename")' but that gives 
> me a
> whole lot of extra text that I don't need or want.
>
> Is there a cleaner way? If not, then how can I parse the text generated by 
> this
> function to strip the path and everything starting with the filename 
> extension?
> I see no way to search a text string from right to left for a sub-string. 
> I
> find it hard to believe that this is an extremely rare requirement.
>
> I do not want to write a function in Basic to accomplish this task since I
> would like this to be compatible with Excel.
>
> I am using OOo version 2.0 (Build 2.0.0.1). I downloaded version 2.0.2
> yesterday and will be upgrading to it extremely soon.
>
> -- 
> Jim 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to