Start a new topic

Replace year

Hi,

I'm new to ImportOmatic and would like some help on replacing a 4 digit year with a 2 digit one.  I have a dictionary that almost works.  My values to match on is:

\d{2}/\d{2}/\d{2}

but I'm having trouble with the Replacement value.  I just want it to return the 2 digit year.  If I insert a "blank" space (not the --BLANK-- option using the + sign but an actual blank space by using the space bar) and click Use Regular Expression I get the two digit year but there is a blank in front of it.  I'm not sure how to just get the two digit year without the blank.

Any help would be appreciated.

Thanks.

Lisa

 

 


I ended up doing this through API. Here's the code if anyone needs it:

_
Public Function ComputedColumn_635785351886118800( _
ByVal oField as ImportOM.API.iField, _
ByVal Cancel As ImportOM.API.iCancel) As String
'This function must return a text value
Dim sReturn As String = ""
Dim sYear As String = ""

sReturn = Year(oField.value())
sYear = Right(sReturn,2)


Return sYear
End Function

Lisa
I tried this with --BLANK-- instead of a space and it worked

The --BLANK-- is added by just clicking the + without anything in the input box.

Replacement Value: --BLANK--
Value to Match: \d{2}/\d{2}/\d{2}

 

image

Excellent job with the custom function!
Login or Signup to post a comment