Hi,
there's also a way to do this kind of thing with Ferret string
functions:
yes? let dates_in = {" 2-apr-18", "12-apr-18"}
yes? let dates = if substring(dates_in, 1, 1) EQ " " then strcat
("0", substring(dates_in, 2, strlen(dates_in)) ) else dates_in
yes? list dates
VARIABLE : IF SUBSTRING(DATES_IN, 1, 1) EQ " " THEN
STRCAT ("0", SUBSTRING(DATES_IN, 2, STRLEN(DATES_IN)) ) ELSE
DATES_IN
SUBSET : 2 points (X)
1 / 1:"02-apr-18"
2 / 2:"12-apr-18"
On 4/3/2018 6:14 AM, Ge Peng - NOAA
Affiliate wrote:
Hi Ryo,
It is the
exact what I was looking for:
let
cDate = spawn("date --date='($current_date)' +'%d–%b–%y'")
define
sym cdate
`cDate`
!-> define sym cdate 03–Apr–18
Thanks
a lot for the solution!
---
Peng