I want to check the data format ,if date is invalid ,replace with null.
xxxx 2001-01-01
yyyy 200-09-09
zzz 2000-009-08
xxxx 2001-01-01
yyyy null
zzz null
Thanks inadvance
Akil
I want to check the data format ,if date is invalid ,replace with null.
xxxx 2001-01-01
yyyy 200-09-09
zzz 2000-009-08
xxxx 2001-01-01
yyyy null
zzz null
Thanks inadvance
Akil
one way:
# nawk '$2!~"[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]"{$2="null"}{print}' infile
xxxx 2001-01-01
yyyy null
zzz null
Hi
Thanks,its working fine
Thanks,
Akil