sort table by file size

Comments

4 comments

  • Official comment
    Avatar
    Awesome Table

    Hello Julita Stanislawska,

    I think you are referring to the Files Cabinet add-on. It is not possible to change the format generated by our add-on. It is automatically set up and cannot be converted. 

    Thank you for your understanding.

    Thomas

  • Avatar
    Randolph Abelardo

    Hello @Julita.

    As you may have noticed, the Files Cabinet add-on generates a file-size column but only non-native files (files that are not from the Google platform like images [.png. jpg., .gif], text files, ...) have actual values in it. These file sizes are generated by Google Drive - and not by our add-on or by Awesome Table. Meaning, our add-on simply extracts the values given by Google Drive. 

    In essence, the unit of measurement used (b, kb Mb, ...) by Google Drive is beyond Awesome Table. And sorting is only possible if Google Drive uses a single unit of measurement for the file size. For now, it's not possible to sort since the file size column is treated as string or plain text values - and not as numbers. You can reach the Google Drive Support community here.

    As for the decimal place, this can simply be fixed by formatting the pertinent column.

    Hope this clarifies everything.

    - Randy (Awesome Table Moderator)

  • Avatar
    Tony Gozdz

    Hi @Randy, thanks for your informative reply--I asked the original question from my wife's account. 

    I figured out the solution to the size sorting problem by converting the Google Drive generated sizes of non-native files by using the following formula in column N:

    =IF(RIGHT(L2,2)="kb",VALUE(LEFT(L2,(LEN(L2)-2)))*1000,IF(RIGHT(L2,2)="Mb",VALUE(LEFT(L2,(LEN(L2)-2)))*1000000,VALUE(LEFT(L2,(LEN(L2)-1)))))

    This column can be further converted to Mb, sorted etc. without any issues.

    Is there any way you would just include this conversion formula in your script when the update time comes?

    Another issue I've found is the following: once the listing is generated, the script auto-updates it and overwrites the previous listing with new values that do not correspond to the original list, including the above-listed formulas even though the root folder appears to be the same.  The add-on setup screen says that Auto-update is ON; how to turn it off?  I don't see any controls to do it. Can this deactivation be done from the Add-on menu in a GSheet?  There's an option there, but I think it was disregarded by the script the one time I tried to tick it off...

    Thanks for making this very useful utility available!

    --Tony

     

     

  • Avatar
    Randolph Abelardo

    That's a nifty solution, @Tony !

    Please create a Feature Request to send your recommendation.

    And to stop the auto-update feature, please read this reply from our colleague, Thomas.

    - Randy (Awesome Table Moderator)

Please sign in to leave a comment.