awk date and time validation


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting awk date and time validation
# 1  
Old 05-11-2009
awk date and time validation

How can i validate if user inserted date and optionly a time is vaild but in awk scripting?
# 2  
Old 05-11-2009
You're using awk to prompt the user for a date and time? Or you have the date and time somewhere (in a variable) and you want awk to validate it?
# 3  
Old 05-17-2009
I got it wrong ,now i am asking how to validate a date and optionly a time in shell scripting (not in awk) when i get the date and time as pararmeters that sent out with the call of the file. (in my case sh union.sh `first parameter ,second parameter...`
# 4  
Old 05-25-2009
Quote:
Originally Posted by tal
I got it wrong ,now i am asking how to validate a date and optionly a time in shell scripting (not in awk) when i get the date and time as pararmeters that sent out with the call of the file. (in my case sh union.sh `first parameter ,second parameter...`
What do first parameter and second parameter represent?
# 5  
Old 05-26-2009
Here it is not important ,what is if that a date or time while the date with format of dd/mm and the time hh:mm:ss
# 6  
Old 05-26-2009
Dear Tal,

You started out asking one thing. Now you are asking something else... maybe. Please give an example of what you expect to see happen. When you speak of validation, do you mean a date like 30/02 is invalid because February has only 28 (or 29) days?
# 7  
Old 05-27-2009
To check if February connection to the year is ok ,the value of the day according to any month ,the value of the month and simularlly like this to do for the time.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Validate date and time in filename by awk

hi i want to validate the date and time in filename filename : mohan.moh.ccyymmdd.ccyymmdd.hhmmss.txt mohan_moh.20151222.20151222.122442.txt i want code that check that date given in filename 20151222 in this format ccyymmdd else it mark file is not valid used in my OS detail is AIX 6... (12 Replies)
Discussion started by: MOHANP12
12 Replies

2. UNIX for Dummies Questions & Answers

Converting string date time to unix time in AWK

I'd like to convert a date string in the form of sun aug 19 09:03:10 EDT 2012, to unixtime timestamp using awk. I tried This is how each line of the file looks like, different date and time in this format Sun Aug 19 08:33:45 EDT 2012, user1(108.6.217.236) all: test on the 17th ... (2 Replies)
Discussion started by: bkkid
2 Replies

3. Shell Programming and Scripting

Access log field - using awk to pull date/time

hey guys. the following line is a line taken from apache's access_log 10.10.10.10 - jdoe "GET /images/down.gif HTTP/1.1" 304 I'm concerned about the field that has the date and time in it. if assuming the delimiter in the file is a space, then the fourth field will always have the date... (5 Replies)
Discussion started by: SkySmart
5 Replies

4. Shell Programming and Scripting

Date validation

File contains below data,how to validate the date using awk command or any command. date formate is fixed as "YYYYMMDD" test1|20120405 test2|20121405 output should be: test1|20120405 Thanks (2 Replies)
Discussion started by: bmk
2 Replies

5. Shell Programming and Scripting

Using awk or nawk to convert epoch time to date format

Looking for some help and usually when I do a search this site comes up. Hopefully someone can give me a little direction as to how to use one of these two commands to achieve what I'm trying to do. What am I trying to do? I need to take the time value in epoch format returned from the... (5 Replies)
Discussion started by: minigts
5 Replies

6. Shell Programming and Scripting

Date and time range extraction via Awk or analysis script?

Hello does anyone know of an awk that will extract log file entries between a specific date and time range, eg: awk '/15\/Dec\/2010:16:10:00/, /15\/Dec\/2010:16:15:00/' access_log but one that works? Or a free command line log file analysis tool/script? I'd like to be able to view... (2 Replies)
Discussion started by: competitions
2 Replies

7. Shell Programming and Scripting

awk & date time format

This gives: grep "qprt -o -dp -N 1 -P" printfile.log.1216 |awk '{print $7, $9}' |grep lpc1z The output like below: lpc1z /cerner/d_prod/print/ccltemp4235396d030a.dat.tmp.1216075330] lpc1z /cerner/d_prod/print/ccltemp4235396d036a.dat.tmp.1216075634] lpc1z... (2 Replies)
Discussion started by: Daniel Gate
2 Replies

8. Shell Programming and Scripting

AWK and sub/gsub: updating a date/time block

I have a file ("modtest") in which I want to update the last date/time block in the lines beginning with a period. Here is a sample: .ROMULT 10150908EDT 10270908EDT 10010908EDT RANGE RAWV2 1.00 .ROMULT 10150908EDT 10270908EDT 10010908EDT FGROUP CHOWANRV 1.00 .RRIMULT 10150908EDT... (10 Replies)
Discussion started by: chrismcg24
10 Replies

9. UNIX for Dummies Questions & Answers

How Can I Do Time Validation in UNIX

I am very new to scripting in UNIX and in need of help. I am creating a program that will check a file that has a target time in the form of HH:MM:SS before another program can begin executing. The file with the target time will only have that target time in it and nothing else. Is there any... (4 Replies)
Discussion started by: mosammey
4 Replies

10. Shell Programming and Scripting

Time Validation in UNIX?

I am very new to scripting in UNIX and in need of help. I am creating a program that will check a file that has a target time in the form of HH:MM:SS before another program can begin executing. The file with the target time will only have that target time in it and nothing else. Is there any way... (1 Reply)
Discussion started by: mosammey
1 Replies
Login or Register to Ask a Question