I have a dat file with some data in it seperated by ‘|’ character.
I want to read each line and take out 5th and 6th column data( date format) from here and then validate the date using unix. I am new to unix . Please let me know how to do it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try using an awk script (http://www.manpagez.com/man/1/awk/) for parsing files. Something like
This can then be extended to perform date validation, depending on what validation needs are. For example – http://unix.derkeiler.com/Newsgroups/comp.unix.shell/2003-08/1340.html seems to perform a reasonable amount of validation.