Hi All,
I'm writing unix script, it should find exact matching in search string. Looks simple but when i started i'm stuck to find the exact match character string.
The unix script reads the records from DB Table. The table will have values something likes these
Feed : A Feed File name : feed_file_yyyymmdd.txt
Feed : B Feed file Name : feed_file1_yymmdd.txt
Feed : C Feed file Name : feed_file2_yyyymmmdd.txt
For the Feed A, I have to look feed file name in "feed_file_20100630.txt", for B "feed_file1_100630.txt", for C "feed_file2_2010Jun30.txt". For the tomorrow month and Data gets changed (tomorrow is 1 Jul 2010).
After reading these values from DB, i have to find what format it has and replace with as of today's date format, look the file is exist in share folder.
I try to implement this with awk
awk ' {
/yyyymmdd/ { #case 1; next }
/yymmdd/ { #case 2; next }
#for all possible formats
}'
for the Feed B it goes to Case 1, but it suppose to go to Case 2.
If i reverse the order for the Feed A, it suppose to go to case 1, but goes to case 2.
I'm unable to achieve this using "-w" option in "grep" command.
I hope i have explained clearly.
Let me know how to resolve my problem