September 21, 201510 yr I importing a huge list as text files from FileBuddy which gives me file names, file location and file size fieldsImporting the text list in the Filemaker database the "SIZE" field is populated with text so I am unable to sort the sizes as numbers. the SIZE field looks as follows: EXAMSPLEs666,73 MB1,36 GB432 KBHow to I write a script so the "SIZE" text field can be converted in an integer?Example of possible results:if the text field is 921,5 MB the resulting number should be 921500000 orif the text field is 2,16 GB the resulting number should be 2160000000 fromorif the text field is 89 KB the resulting number should be 89000The syntax in the fields is always the samedigits followed with a space then KB or MB or GB. Some include a ","Any help highly appreciated Edited September 21, 201510 yr by dkey editing
September 21, 201510 yr You could try this calculation as the option of auto-entering a calc for that field: Let([ n = GetAsNumber ( Self ) ; t = RightWords ( Self ; 1 ) ] ; n * Case( t = n ; 1 ; t = "KB" ; 10^3 ; t = "MB" ; 10^6 ; t = "GB" ; 10^9 ) )
September 21, 201510 yr Author Thanks a great lot Raybaudi it works like charm .... I really must try and leanr the LET function as it seems to solve all kind of problems Regards
Create an account or sign in to comment