- Posts: 52
- Thank you received: 0
Date reformattig in tTransformers
5 years 10 months ago #17312
by trally
Date reformattig in tTransformers was created by trally
Hi there
I have been trying to control the date format on output from a transformation run without any success -
In the attached doc and files you will find a transformation process that reads and extracts a group of records from a MS SQL database
In the record is a date that you will see in the screen shots is formatted as yyyy-mm-dd 00:00:00.0000
I have been trying to have the date output to a Json record as yyyy-mm-dd - have tried Date Format and Date Reformat -
Date format always comes out as dd-mm-yyyy - the Reformat Date did get rid of the hhh:mm:ss.ssss
Similar problem where I use the Current Date to enter the current date into a field in the Json record
Should I be using a different Transformer function?
Also if you have some examples of the "If Null or Empty String" Transformer function that would be great
I was trying to use it to resolve the choice of entry from either the Given Name or Preferred Name fied in the SQL record
I was trying to use the into from these fields such that if the Preferred Name field was empty then the Given Name field data would be used.
Finally I am trying to find some jpeg image resizing software was to enable taking a Jpeg image filed and first resizing it to a horizontal axis of 250 pixels, then convert to Base64 to enter the image as part of a members data for uploading to a Cloud based system. Any suggestion of a software utility that would handle this would be appreciated.
Thank you for your assistance
Regards
Tral Cash
I have been trying to control the date format on output from a transformation run without any success -
In the attached doc and files you will find a transformation process that reads and extracts a group of records from a MS SQL database
In the record is a date that you will see in the screen shots is formatted as yyyy-mm-dd 00:00:00.0000
I have been trying to have the date output to a Json record as yyyy-mm-dd - have tried Date Format and Date Reformat -
Date format always comes out as dd-mm-yyyy - the Reformat Date did get rid of the hhh:mm:ss.ssss
Similar problem where I use the Current Date to enter the current date into a field in the Json record
Should I be using a different Transformer function?
Also if you have some examples of the "If Null or Empty String" Transformer function that would be great
I was trying to use it to resolve the choice of entry from either the Given Name or Preferred Name fied in the SQL record
I was trying to use the into from these fields such that if the Preferred Name field was empty then the Given Name field data would be used.
Finally I am trying to find some jpeg image resizing software was to enable taking a Jpeg image filed and first resizing it to a horizontal axis of 250 pixels, then convert to Base64 to enter the image as part of a members data for uploading to a Cloud based system. Any suggestion of a software utility that would handle this would be appreciated.
Thank you for your assistance
Regards
Tral Cash
Please Log in or Create an account to join the conversation.
5 years 10 months ago #17313
by admin
Mike
ETL Architect
Replied by admin on topic Date reformattig in tTransformers
1) No doc files were attached
2) You should be using reformatdate transformation function
2) You should be using reformatdate transformation function
Mike
ETL Architect
Please Log in or Create an account to join the conversation.
5 years 10 months ago #17316
by trally
Replied by trally on topic Date reformattig in tTransformers
Hi there
Did not check the size limit hence no attachment!
I have been trying to use Reformat Date in the Transformation process - I must be missing something
In the attached files you will see the current set-up of Reformat Date where I must have the wrong setup for the formats
I have tried several different formats in the the properties but always end up with the same data output format of dd-mm-yyy - I need the reverse of yyyy-mm-dd
Hopefully you will see what I am missing?
Regards
Did not check the size limit hence no attachment!
I have been trying to use Reformat Date in the Transformation process - I must be missing something
In the attached files you will see the current set-up of Reformat Date where I must have the wrong setup for the formats
I have tried several different formats in the the properties but always end up with the same data output format of dd-mm-yyy - I need the reverse of yyyy-mm-dd
Hopefully you will see what I am missing?
Regards
Please Log in or Create an account to join the conversation.
5 years 10 months ago #17317
by admin
Mike
ETL Architect
Replied by admin on topic Date reformattig in tTransformers
On the screenshot you provided. "New Date format" is missing, it must populated with the format you want
Mike
ETL Architect
Please Log in or Create an account to join the conversation.
5 years 10 months ago #17318
by admin
Mike
ETL Architect
Replied by admin on topic Date reformattig in tTransformers
"Also if you have some examples of the "If Null or Empty String" Transformer function that would be great"
Here are some examples I hope you will find them useful
The result depends on Value when value is empty string the result is Success otherwise the result it Failure
Here are some examples I hope you will find them useful
The result depends on Value when value is empty string the result is Success otherwise the result it Failure
Mike
ETL Architect
Please Log in or Create an account to join the conversation.
- Peter.Jonson
-
- Offline
- Platinum Member
-
5 years 10 months ago #17319
by Peter.Jonson
Peter Jonson
ETL Developer
Replied by Peter.Jonson on topic Date reformattig in tTransformers
For images processing I think this is this is the best command line utility
www.imagemagick.org/script/index.php
Something like this should work:
Get the portable Windows binary, then you can use magick.exe to do what you want pretty easily. For example, to resize (by half) all the png images in folder 1 to folder 2:
@echo off
if not exist 2 md 2
for %%a in (1\*.png) do "path\to\magick.exe" -resize 50x50% "1\%~nxa" "2\%~nxa"
stackoverflow.com/questions/40456998/a-b...ipt-to-resize-images
www.imagemagick.org/script/index.php
Something like this should work:
Get the portable Windows binary, then you can use magick.exe to do what you want pretty easily. For example, to resize (by half) all the png images in folder 1 to folder 2:
@echo off
if not exist 2 md 2
for %%a in (1\*.png) do "path\to\magick.exe" -resize 50x50% "1\%~nxa" "2\%~nxa"
stackoverflow.com/questions/40456998/a-b...ipt-to-resize-images
Peter Jonson
ETL Developer
Please Log in or Create an account to join the conversation.