1 Reply Latest reply on Apr 20, 2012 3:11 AM by raybaudi

    Roman Numbers and Poper Case

    DPmax

      Title

      Roman Numbers and Poper Case

      Post

      I'm importing data and I'd like to change everything to Popper Case... no problem, until I have roman numbers that I do not what in proper case. I was using the below, but I can't think of a way to deal with numbers like IV and VI. If I just did a substitute like ["Vi ; "VI"] it would also impact words beginning with Vi. Any suggestions?

      Thanks

      // changes all text to Proper Case, the sections in brackets are for exceptions, the order of the exceptios matter
      Trim (
      TextFormatRemove ( 
      Substitute ( Proper ( Self ) ;
      ["Iii" ; "III"] ;
      ["Ii" ; "II"] ;
      ["Www" ; "WWW"] ;
      ["Ww" ; "WW"] ;
      ["WWii" ; "WWII"] ;
      ["WWi" ; "WWI"] ;
      ["."; ""] ;
      [" V1" ; " v1"] ;
      [" V2" ; " v2"] ;
      [" V3" ; " v3"] ;
      [" V4" ; " v4"] ;
      [" V5" ; " v5"] ;
      [" V6" ; " v6"] ;
      [" V7" ; " v7"] ;
      [" V8" ; " v8"] ;
      [" V9" ; " v9"] )))

        • 1. Re: Roman Numbers and Poper Case
          raybaudi

          Something like:

          TrimAll (Substitute ( Proper ( text ) & " " 
          ; [ "Viii " ; "VIII " ]
          ; [ "Vii " ; "VII " ]
          ; [ "Vi " ; "VI " ]
          ; [ "Iv " ; "IV " ]
          ) ; 1 ; 1 )
          Note that in the text there aren't to be any meaning word like Iv or Vi, because they will be always transformed to IV and VI.
          You have also to eliminate any trailing punctuation from the original text.