Compare date in .txt with system date and remove if it's lesser than system date


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Compare date in .txt with system date and remove if it's lesser than system date

I m working on shell scripting and I m stuck where in my .txt file there is column as expiry date and I need to compare that date with system date and need to remove all the rows where expiry date is less than system date and create a new .txt with update.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Compare date in .txt with system date and remove if it's lesser than system date
Stuti
Can someone help me with the code wherein there is a file f1.txt with different column and 34 column have expiry date and I need to get that and compare with system date and if expiry date is <system date remove those rows and other rows should be moved to new file f2.txt . I don't want to delete...... UNIX for Beginners Questions & Answers
2
UNIX for Beginners Questions & Answers
Compare the system date with date from a text file
Loc
I get the date that's inside a text file and assigned it to a variable. When I grep the date from the file, I get this, Not After : Jul 28 14:09:57 2017 GMT So I only crop out the date, with this command echo $dateFile | cut -d ':' -f 2,4The result would be Jul 28 14:57 2017 GMT How do I...... Shell Programming and Scripting
3
Shell Programming and Scripting
Adding days to system date then compare to a date
kokoro
Hi! I am trying to read a file and every line has a specific date as one of its fields. I want to take that date and compare it to the date today plus 6 days. while read line do date=substr($line, $datepos, 8) #date is expected to be YYYYMMDD if ; then ...proceed commands ...... Shell Programming and Scripting
1
Shell Programming and Scripting
Delete a row from a file if one column containing a date is greater than the current system date
chumsky
Hello gurus, I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4: NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~...... UNIX for Dummies Questions & Answers
4
UNIX for Dummies Questions & Answers
Compare date from db2 table to yesterday's Unix system date
sasaliasim
I am currently running the following Korn shell script which works fine: #!/usr/bin/ksh count=`db2 -x "select count(*) from schema.tablename"` echo "count" I would like to add a "where" clause to the 2nd line that would allow me to get a record count of all the records from schema.tablename...... Shell Programming and Scripting
9
Shell Programming and Scripting

Featured Tech Videos