Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Error with replaceText timestamp add a quota

Solved Go to solution
Highlighted

Error with replaceText timestamp add a quota

Contributor

Hello,

I have a timestamp column in my flowfile written in this way 2008:05:17 17:23:01. I want to add a quota to this value so i can insert it in postgresql table. I used replace text like this :

search value : ((\d{4})([\-\/.])([0-3]?\d)\2([0-3]?\d)|([0-3]?\d)([\-\/.])([0-3]?\d)\6(\d{4}))(?:\s+([012]?\d)([:hap])([0-5]\d))([:hap])([0-5]\d)

replacement value : ' ((\d{4})([\-\/.])([0-3]?\d)\2([0-3]?\d)|([0-3]?\d)([\-\/.])([0-3]?\d)\6(\d{4}))(?:\s+([012]?\d)([:hap])([0-5]\d))([:hap])([0-5]\d) '

but didn't work

need ur help plz

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Error with replaceText timestamp add a quota

Super Guru
@Amira khalifa

You are having timestamp column format as 2008:05:17 17:23:01(with colon delimiter).

Use the ReplaceText processor with below configs

74498-replacetext.png

Search Value

(\d{4}:\d{2}:\d{2})(\s+)(\d{2}:\d{2}:\d{2})

Replacement Value

'$1$2$3'

Character Set

UTF-8

Maximum Buffer Size

1 MB //change the value as per your flowfile size

Replacement Strategy

Regex Replace

Evaluation Mode

Entire text

Input Flowfile:

2008:05:17 17:23:01 --other fields

Outputflowfile:

'2008:05:17 17:23:01' --other fields

-

If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.

1 REPLY 1

Re: Error with replaceText timestamp add a quota

Super Guru
@Amira khalifa

You are having timestamp column format as 2008:05:17 17:23:01(with colon delimiter).

Use the ReplaceText processor with below configs

74498-replacetext.png

Search Value

(\d{4}:\d{2}:\d{2})(\s+)(\d{2}:\d{2}:\d{2})

Replacement Value

'$1$2$3'

Character Set

UTF-8

Maximum Buffer Size

1 MB //change the value as per your flowfile size

Replacement Strategy

Regex Replace

Evaluation Mode

Entire text

Input Flowfile:

2008:05:17 17:23:01 --other fields

Outputflowfile:

'2008:05:17 17:23:01' --other fields

-

If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.