6 Replies Latest reply on Nov 6, 2017 2:20 AM by Caniut Alex

    re_sub in Jython FDMEE

    Caniut Alex
       

      Version :Hyperion 11.1.24 210


      Jython code:

      f2
      = codecs.open(L_strFile,"r","UTF-16_LE")
      f3
      = codecs.open(N_strFile,"w","UTF-16_LE")
          for line in f2:
          f3
      .write(re.sub(r'[\d \.\,\-eE;]+$', 'Nodata ', line))
      f2
      .close()
      f3
      .close()

      Issue :

      I got a reg_ex expression in jython to replace the last column in a file to NODATA as below , however this code works on my notepad++ but when it comes to fdmee(Oracle ETL) it doesn't work but it does copy the data to the new file(Expected replace never happens). 

      My Data file !

      Actual;FY17;Dec;YTD;GOE;;12345;GO;12;E1;5687;

      Actual;FY17;Dec;YTD;MOE;;12346;MO;12;E2;1234; 

       

      Looking for the code ,basically replace all the last column of the file to "NODATA"

      output to a new file will be

      Actual;FY17;Dec;YTD;GOE;;12345;GO;12;E1;NODATA;

      Actual;FY17;Dec;YTD;MOE;;12346;MO;12;E2;NODATA;

       

      Help is much appreciated!.