Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 06-27-2017 04:22 PM
Hello,
Is there a processor help with converting a string(Datetime format: 2017-01-18 13:28:17) to long(133434444545) in a csv field?
Thanks.
Created 06-27-2017 04:58 PM
Hi @Alvin Jin
I haven't seen a special processor to do this yet, but, I've seen a few examples where this can be done using the NiFi Expression Language. These two links should get you going.
Created 06-27-2017 04:58 PM
Hi @Alvin Jin
I haven't seen a special processor to do this yet, but, I've seen a few examples where this can be done using the NiFi Expression Language. These two links should get you going.
Created 06-27-2017 05:24 PM
Thank you for your response.
${now():toNumber():format('yyyy-MM-dd')}It seems above expression works for attributes.
How to use it to convert a column in csv file?
Thanks.
Created 06-27-2017 07:21 PM
Hi @Alvin Jin
You could use a combination of ExtractText and ReplaceText with some RegEx, though it might be a bit tedious. There is a good example here with screens that you can use as a guide:
Created 06-28-2017 08:16 PM
As of NiFi 1.3.0, you can use UpdateRecord for this. If your incoming field name is "createdOn", you can add a user-defined property named "/createdOn" whose value is the following:
${field.value:toDate('yyyy-mm-dd HH:mm:ss.SSS'):toNumber()}Note that you may need to change the type of createdOn from String (in the Reader's schema) to Long (in the Writer's schema).
Created 09-12-2018 10:56 AM
How would I use this with a literal letter in my timestamp format? My timestamp format looks like this:
yyyy-mm-dd'T'HH:mm:ss.SSS