![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
help
I want to check the data format ,if date is invalid ,replace with null.
Code:
xxxx 2001-01-01 yyyy 200-09-09 zzz 2000-009-08 xxxx 2001-01-01 yyyy null zzz null Akil |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
one way:
Code:
# 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
|
|
#3
|
|||
|
|||
|
Hi
Thanks,its working fine Thanks, Akil |
|||
| Google The UNIX and Linux Forums |