Jump to content
Server Maintenance This Week. ×

decimal x.xm to minutes:seconds


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

Recommended Posts

  • Newbies

Hi forum,

I'm struggling with a time field.

I'm importing a CSV file that contains a field (it is a text field at the moment) with a duration value in decimals, followed by a letter "m" (i.e. "1.5m", that is for 1 minute and 30 seconds).

I'm not being able to let that field shows the value in a mm'ss" format, as I would.

Do you have any ideas?

Thanks!

Link to comment
Share on other sites

  • Newbies
13 minutes ago, comment said:

Is this a one-time import, or do you need to do this periodically? 

everyday, I have to import a csv file in a format I've created.

This csv file, contains several different records, each one referring to an audio file, with timecode start and duration. a sort of report of daily activity and it includes that kind of duration field.

I attach a picture to explain better.

Thanks!

 

Schermata 2017-05-13 alle 15.13.29.png

Edited by valentinomolino
Link to comment
Share on other sites

I would import the value into a text field, then use the importing script to populate the real Duration field (whose type is Time) with a calculated value =

60 * ImportedText

You could also set the Duration field to auto-enter this calculation (if your import performs auto-enters). Or just make it a calculation field (result is Time), if you don't need to modify it.

 

Another option is to import directly into the Duration field, then replace the field's contents with a calculation =

GetAsTime ( 60 * Filter ( YourTable::Duration ; ".0123456789" ) )

but that's a little flimsy, IMHO.

 

Edited by comment
Link to comment
Share on other sites

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