Jump to content

Removing file path from name


This topic is 4838 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Not new to FM but fairly new to design, etc etc. A little background first:

My company has thousands of documents that we use for many different machines, accounts, etc. Currently they are in a disheveled state, mismatched etc. Documents are mostly pdf's but also some .xls and .doc files. What I am attempting to do is to setup a database to better organize these files and make it easier to find what we need. They reside on the root level of c: and it is a folder with many subfolders that contain documents. We use Copernic and/or Google Desktop to find what we need. Neither solution works very well as we get a lot of extraneous hits. My end goal would be to have a runtime solution were we could enter a find through check boxes the machine model, account, description, etc to return relevant documents.

Right now I am starting with the technical bulletins as we use them the most. I have created a table with the following fields: Document Title; Document Type (TI Bulletin, Service Manual, Parts Manual drop down list) ; Machine Type; Account; Document (Container); Keywords, and Context. I want to use the container to store references to the files so that a double click opens them without the need to export. I also assume that this will keep the solutions overall file size as well as the index easily managed. To make the initial data entry easier and to facilitate the ongoing onslaught of new documents I set up the Document Title to refer via a simple calculation to the Document field for its name. When the file is stored within FM this works fine but when stored as a reference I get "file:TI Bulletins/ED/ED017 - LP1000 - CUT SORT PUNCH PIN BREAKAGE COUNTERMEASURE.pdf" Is there a way to remove everything to the left of the last "/" so that my Document name would read "ED017 - LP1000 - CUT SORT PUNCH PIN BREAKAGE COUNTERMEASURE.pdf"? The file path will change as far as different subfolders etc. but everything after the last "/" I would like to have as the document title.

The Context field I am using for text. I have used a script to extract text from the files and have pasted it into each one. I am doing this so that the contents of the container are indexed for content searching. Any issues foreseeable with this?

Link to comment
Share on other sites

When the file is stored within FM this works fine but when stored as a reference I get "file:TI Bulletins/ED/ED017 - LP1000 - CUT SORT PUNCH PIN BREAKAGE COUNTERMEASURE.pdf"

That's not ALL you get: there should also be a second line containing the absolute path to the file.

Try =

Let ( [

path = GetValue ( ContainerField ; 1 ) ;

len = Length ( path ) ; 

pos =  Position ( path ; "/" ; len ;  -1 ) 

] ;

Right ( path ; len - pos )

)

Link to comment
Share on other sites

  • Newbies

That's not ALL you get: there should also be a second line containing the absolute path to the file.

Try =

Let ( [

path = GetValue ( ContainerField ; 1 ) ;

len = Length ( path ) ; 

pos =  Position ( path ; "/" ; len ;  -1 ) 

] ;

Right ( path ; len - pos )

)

Thank You worked great, just what I needed. Know of any in depth books on advanced scripting/calculations on FileMaker? I got the basics down as far as design and layout but realize my limitations now that I started this project. Thanks again.

Link to comment
Share on other sites

This topic is 4838 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.