Identifying Missing File Sequence


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Identifying Missing File Sequence
# 1  
Old 01-21-2014
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.

Code:
APKRISPSIN320131231201319_0983,1,54,125,
APKRISPSIN320131231233522_1879,1,27,118,
APKRISPSIN320131231233721_1887,1,0,6,
APKRISPSRM320140101025823_2478,1,0,0,
APKRISPSRM320140101025919_2479,4,0,0,
APKRISPSRM320140101025924_2480,6,7370,13981,
ASKRISPSIN120131231235048_8870,17,10661,72542,
ASKRISPSIN120131231235056_8871,11,7336,46301,
ASKRISPSIN120131231235150_8872,8,214,608,
ASKRISPSIN120131231235246_8873,4,104,398,
ASKRISPSIN120131231235251_8874,13,8139,34388,
ASKRISPSRM120140101095451_9545,4,5220,2344,
ASKRISPSRM120140101095457_9546,2,512,0,
ASKRISPSRM120140101095554_9547,2,39911,4343,
ASKRISPSRM120140101095652_9548,1,9341,5407,
DLKRISPSIN120131231235048_8870,32,194,180,
DLKRISPSIN120131231235056_8871,36,57,17,
DLKRISPSIN120131231235150_8872,25,157,151,
DLKRISPSIN120131231235246_8873,43,251,225,
DLKRISPSIN120131231235251_8874,48,381,212,
DLKRISPSIN120131231235347_8875,48,2035,568,
DLKRISPSIN120131231235354_8876,34,310,301,
DLKRISPSRM120140101132256_9879,28,188146,447781,
DLKRISPSRM120140101132353_9880,52,1191351,4888375,
DLKRISPSRM120140101132359_9881,41,494989,3373621,
DLKRISPSRM120140101132455_9882,47,1187497,2552643,

Let me explain the file name format.
First 2 character as sytem code, i.e
Code:
 DL, AP, AS

,
Code:
KRIS

as constant, next 4 character are also constand as input and output
Code:
PSIN & PSRM

, then time stamd
Code:
YYYYMMDDHHMMSS

and then litiral string
Code:
_

file sequence number
Code:
0000 to 9999

.

Each PSIN & PSRM has file sequence starting from 0000 and ends with 9999, if any duplicate found then the time stamp should be differ.

Now I want to identify missing sequence out of this in below format, my file may contain more than million record.

Code:
DLKRISPSRM_Missing Sequence


Request your help in resolving the same.
# 2  
Old 01-21-2014
What is that single digit before YYYYMMDDHHMMSS ?
# 3  
Old 01-21-2014
Just missed that part, it's the part of
Code:
PSIN & PSRM

as the split of each file.

Regret for inconvenience.
# 4  
Old 01-21-2014
Can we have sample output please
# 5  
Old 01-21-2014
As I have mentioned above, Output file format Required
Code:
DLKRISPSRM1_Missing Sequence

# 6  
Old 01-21-2014
Quote:
Originally Posted by rramkrishnas
As I have mentioned above, Output file format Required
Code:
DLKRISPSRM1_Missing Sequence

Thank You.
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 dates

Hi Experts, I have written the below script to check the missing files based on the date in the file name from current date to in a given interval of days. In the file names we have dates along with some name. ex:jera_sit_2017-04-25-150325.txt. The below script is working fine if we have only... (10 Replies)
Discussion started by: nalu
10 Replies

2. Shell Programming and Scripting

To check the missing file based on sequence number.

Hi All, I have a requirement that i need to list only the missing sequences with a unix script. For Example: Input: FILE_001.txt FILE_002.txt FILE_005.txt FILE_006.txt FILE_008.txt FILE_009.txt FILE_010.txt FILE_014.txt Output: FILE_003.txt FILE_004.txt FILE_007.txt FILE_011.txt... (5 Replies)
Discussion started by: Arun1992
5 Replies

3. Shell Programming and Scripting

How to find a missing file sequence using shell scripting?

Hey guys, I want the below files to be processed with the help of BASH so that i will be able to find the missing file names : PP01674520141228X.gz PP01674620141228X.gz PP01674820141228X.gz PP01674920141228X.gz PP01675420141228X.gz PP01675520141228X.gz PP01676020141228X.gz . . . .... (4 Replies)
Discussion started by: TANUJ
4 Replies

4. Shell Programming and Scripting

Find the missing sequence

Dear all i am having file with max 24 entries. i want to find which sequence is missing file is like this df00231587.dat df01231587.dat df03231587.dat df05231587.dat . . . df23231587.dat the changing seq is 00-23,so i would like to find out which seq is missing like in above... (13 Replies)
Discussion started by: sagar_1986
13 Replies

5. Shell Programming and Scripting

Find missing sequence

Hi, I need to find out the missing sequence from a list. However the issue is there is not a fixed start and end, it depends on the generation of files. For eg, it might start with 4000 and end with 9000. Based on this, I need a script which greps the start and end sequence from the... (3 Replies)
Discussion started by: danish0909
3 Replies

6. Shell Programming and Scripting

Case script to get missing sequence among files

I want to use case statement to find the range of missing sequence in my directory which it has some few ( dat & DAT ) files my directory /home/arm/my_folder/20130428 contains : f01_201304280000.DAT f01_201304280001.DAT f01_201304280003.DAT f02_201304280000.dat f02_201304280002.dat... (2 Replies)
Discussion started by: arm
2 Replies

7. 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

8. Shell Programming and Scripting

How to check missing sequence?

I want to listed files every hours and check the missing sequence my file format is CV.020220131430.txt CV.020220131440.txt CV.020220131450.txt CV.ddmmyyhhm.txt how to check if i have missing files in sequence .. thanks (3 Replies)
Discussion started by: before4
3 Replies

9. Shell Programming and Scripting

How to take the missing sequence Number?

Am using unix aix KSH... I have the files called MMRR0106.DAT MMRR0206.DAT MMRR0406.DAT MMRR0506.DAT MMRR0806.DAT .... ... MMRR3006.DAT MMRR0207.DAT These files are in one dircetory /venky ? I want the output like this ? Missing files are : MMRR0306.DAT MMRR0606.DAT... (7 Replies)
Discussion started by: Venkatesh1
7 Replies

10. Shell Programming and Scripting

print out missing files in a sequence

Hello all, I have several directories with a sequence of files like this IM-0001-0001.dcm IM-0001-0002.dcm IM-0001-0003.dcm IM-0001-0004.dcm IM-0001-0005.dcm I would like to print out the name of the file that is missing. I currently have the following ineffecient way to do this... (4 Replies)
Discussion started by: avatar_007
4 Replies
Login or Register to Ask a Question