My source file having one date column. The formate of the date column is yyyymm. I need to validate whether all the rows are in same format in the given file. If it is not I have captured that records in a separate file. I am very new to Unix. I don't how to achieve this. Plz help me to achieve this
first convert the date to the required date format using to_char and specifying the date format u need.. then validate your input using the check constraints.. c if this helps.. even i am new to unix
Try:
grep -E -v '[0-9]{6}' file > newfile
egrep -v '[0-9]{6}' file > newfile
or:
awk '!/[0-9]{6}/' file > newfile