Jump to content
Server Maintenance This Week. ×

Writing an export contents script for all records, but what about different extensions?


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

Recommended Posts

I can write a script that goes through each record and exports all the containers, but not all of my containers have the same file type. Is there a way to make it just either export the original file name, or preserve the extension?

I have 15 containers per record, and I would prefer to name them "1.original extension", "2.original extension", etc. Is that possible?

Thanks!

Link to comment
Share on other sites

Do all your container fields contain the original extension? You can check this by looking at the result of =

GetAsText ( YourContainerField )

If the answer is yes, you can parse out the original extension from there and use it in the export.

I have 15 containers per record

That doesn't sound like the best arrangement; why not keep them as separate records of a related table?

Link to comment
Share on other sites

Thanks! Yes, they have the original extension, and I will figure out how to parse after the period. I'm not an expert on parsing, but that part I should be able to figure out. Thank you for the help (again). I do have a table of Property Images, which is where they are stored.

Link to comment
Share on other sites

If all your files have a three-letter extension, it could be as simple as =

Right ( FileName ; 3 )




(or 4, to include the period). Otherwise, try =




Let (

len = Length ( FileName )

;

Right ( FileName ; len - Position ( FileName ; "." ; len ;  -1 ) )

)

Link to comment
Share on other sites

This topic is 4256 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.