Sometime today, Linux @ Ramshyam wrote:
Say I have file ... \root\sandeep\log111.txt
You mean /root/sandeep/log111.txt
This files has a lot of text and one particulr line is ..... ##Date 24-07-2001
Depends on your programming environment. You didn't mention anything about it.
Assuming you want to do it from the shell -
LOG_FILE=/root/sandeep/log111.txt MY_DATE=$(egrep '^##Date +.+$' $LOG_FILE | tr -s ' ' | cut -f2 -d' ') echo $MY_DATE # Should display the date
Manish