Identifying missing file dates


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Identifying missing file dates
# 8  
Old 05-08-2017
Why not
Code:
ls -l ${path}/*${start}.txt

?
# 9  
Old 05-09-2017
Hi Rudic,

This one won't work becoz we have time stamp in the date i.e.2017-04-24-150325.txt.And also the file format is not constant.

Please help me.

Thanks
# 10  
Old 05-09-2017
Why not
Code:
ls -l ${path}/*${start}-??????.txt

?
# 11  
Old 05-10-2017
Hi nalu,
You need to learn to indent your code so you (and people trying to help you) can have a better chance of seeing the structure of your code and have a better chance of understanding what it is doing.

Despite what you have said about your code working correctly to find missing dates in the last 10 days in the single date format filenames (and refusing to tell us what operating system and shell you're using), one might guess that you're using an operating system that uses the GNU utilities date utility, a sed utility that accepts a -r option, and a 1993 or later version of ksh and that your code only works to find missing dates and times (to the second) for the last 5 (not 10) days. One might also guess that since the likelihood of finding a file with a date and time stamp that matches to the second is not high, your code doesn't really work as well as you have indicated or there is something else going on here that you have not explained to us.

And, you have not explained why there are variables like check_date in your code (which you have said is the entire purpose of your code). And, why do you need all of the complicated reformatting of your date format string arguments when the strings defining your format string are included in your script (not read from an external source). Why not just define the format string (or strings) in your source to begin with?

You say you want 10 days of dates checked for filenames with 1 date in the filename and for filenames with 2 dates in the filename, but you have not been at all clear about whether you want two separate lists or if you just want one list of dates not included in either filename format.

PLEASE (as RudiC requested in post #2 in this thread):
  1. tell us what operating system you're using (including the release number),
  2. tell us what shell you're using (including the version number), and
  3. tell us clearly what output you hope to produce:
    1. one list or two lists,
    2. date match or date and timestamp match,
    3. do all of the files you want to process have filenames that end with characters in the format YYYY-mm-dd-HHMMSS.txt (i.e. all files end with a date and timestamp for the date you're interested in followed by the string .txt) or are there other filename formats that need to be processed,
    4. is the number of days to be processed always 10 or is it a parameter to your script, and
    5. is there anything else that we need to know about what you're trying to do?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Identifying Missing File Sequence

Hi, I have a file which contains few columns and the first column has the file names, and I would like to identify the missing file sequence number form the file and would copy to another file. My files has data in below format. APKRISPSIN320131231201319_0983,1,54,125,... (5 Replies)
Discussion started by: rramkrishnas
5 Replies

2. Programming

Identifying a missing primary key

I have the following method to identify missing primary keys in a MySQL database schema: USE information_schema; SELECT xx.table_name FROM (SELECT table_name, COUNT(*) FROM columns WHERE table_schema = @myDB GROUP BY table_name, column_key) xx GROUP BY xx.table_name HAVING COUNT(*) = 1; I... (0 Replies)
Discussion started by: figaro
0 Replies

3. Shell Programming and Scripting

Identifying presence and name of new file(s)?

I have an HP-UX server that runs a script each night. The script connects to an SFTP server and downloads all xml files (if any are present) from a certain folder, and then deletes the files from the SFTP server. So sometimes it will download a new file, sometimes it will download 2 or 3 new... (4 Replies)
Discussion started by: lupin..the..3rd
4 Replies

4. UNIX for Advanced & Expert Users

How to get the Missing dates between two dates in the table?

Hi Am Using Unix Ksh ... I have a Table called date select * from date ; Date 01/02/2013 06/02/2013 I need the output as Missing Date 01/02/2013 02/02/2013 03/02/2013 04/02/2013 05/02/2013 06/02/2013 (2 Replies)
Discussion started by: Venkatesh1
2 Replies

5. Shell Programming and Scripting

Identifying the file completion

Hi, A script is running for multiple databases so data is also being populated for multiple DBs in a.txt file. I need to rename this file once all the data is populated. Kindly suggest me How can I check once file is populated completely before renaming? Thanks in advance. (3 Replies)
Discussion started by: ravigupta2u
3 Replies

6. UNIX for Dummies Questions & Answers

How to write the dates between 2 dates into a file

Hi All, I am trying to print the dates that falls between 2 date variables into a file. Here is the example. $BUS_DATE =20120616 $SUB_DATE=20120613 Output to file abc.txt should be : 20120613,20120614,120120615,20120616 Can you pls help me accomplish this in LINUX. Thanks... (5 Replies)
Discussion started by: dsfreddie
5 Replies

7. Shell Programming and Scripting

Identifying suffixes in a file and printing them out

Hello, I am interested in finding and identifying suffixes for Indian names through an awk script or a perl program. Suffixes normally are found at the end of a word as is shown in the sample given below. What I need is a perl script which will identify suffixes of a defined lenght to be given in... (4 Replies)
Discussion started by: gimley
4 Replies

8. Shell Programming and Scripting

Problem identifying charset of a file

Hi all, My objective is to find out the charset using which a file is encoded. (The OS is SunOs) I have set NLS_LANG to AR8MSWIN1256 and spooled the file. When viewed the file using vi, I saw the following \307\341\321\355\307\326 I then inserted the line containing these codes in a... (3 Replies)
Discussion started by: sridhar_423
3 Replies

9. Shell Programming and Scripting

identifying null values in a file

I have a huge file with 20 fileds in each record and each field is seperated by "|". If i want to get all the reocrds that have 18th or for that matter any filed as null how can i do it? Please let me know (3 Replies)
Discussion started by: dsravan
3 Replies

10. Programming

Identifying and removing control characters in a file.

What is the best method to identify an remove control characters in a file. Would it be easier to do this in Unix or in C. (0 Replies)
Discussion started by: oracle8
0 Replies
Login or Register to Ask a Question