help - script can check jump sequence?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help - script can check jump sequence?
# 8  
Old 09-20-2006
an alternative in Python:
Code:
#!/usr/bin/python
import os
os.chdir("/dir_with_lots_of_files")
files = [ f for f in os.listdir(os.getcwd()) ] #eg ['AABBCC0010', 'AABBCC0011', 'AABBCC0012', 'AABBCC0013', 'AABBCC0014', 'AABBCC0015', 'AABBCC0018', 'AABBCC0020', 'AABBCC0021']
num = map(str, sorted( [ int(i[-4:]) for i in files ] ) )
for iter in range( int(num[0]) , int(num[-1]) + 1):
     if not str(iter) in num: 
           print "Sequence stop at ", str(iter)

# 9  
Old 09-20-2006
an alternative in Python:
Code:
#!/usr/bin/python
import os
os.chdir("/dir_with_lots_of_files")
files = [ f for f in os.listdir(os.getcwd()) ] #eg ['AABBCC0010', 'AABBCC0011', 'AABBCC0012', 'AABBCC0013', 'AABBCC0014', 'AABBCC0015', 'AABBCC0018', 'AABBCC0020', 'AABBCC0021']
num = map(str, sorted( [ int(i[-4:]) for i in files ] ) ) #eg ['10', '11', '12', '13', '14', '15', '18', '20', '21']
for iter in range( int(num[0]) , int(num[-1]) + 1):
     if not str(iter) in num: 
           print "Sequence stop at ", str(iter)

Output:

Sequence stop at 16
Sequence stop at 17
Sequence stop at 19
# 10  
Old 09-20-2006
Hi aigles, your modified look work.... Smilie

Thanks all!
# 11  
Old 11-01-2008
Script for Checking sequence of archive log files in DR site moved by using FTP

Hello,


I need Unix script for Checking sequence and get output in a file for missing sequences information.
We are moving archive log to a server for DR .if any files miss from sequence DR will fails. so we need script to monitor sequence of files which are FTP from the Production servers .
Some plz provide me script for the same .

Thanks in Advance

Raj
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

Notify when the script run(hourly)on my jump-box only when there is a failure on my remote-box

Team, Presently I have a script, which i have set up cron on one of my Jump-boxes,and gives me the output on every hourly basis,fetching the data from the remote machine.Basically it gives me the list of all active users logged and its count once we execute the script.Here the count is... (6 Replies)
Discussion started by: whizkidash
6 Replies

3. Shell Programming and Scripting

[Solved] How to make the script jump to sleep?

Hi Gurus, I am working one below script. I am stuck at the else condition. #!/bin/ksh while : do cur_date=`date |cut -d"," -f 1` cur_time=`date +"%H%M" if ||; then if && ; then echo "File " $FIRST_FILE "... (8 Replies)
Discussion started by: ken6503
8 Replies

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

5. Shell Programming and Scripting

find common entries and match the number with long sequence and cut that sequence in output

Hi all, I have a file like this ID 3BP5L_HUMAN Reviewed; 393 AA. AC Q7L8J4; Q96FI5; Q9BQH8; Q9C0E3; DT 05-FEB-2008, integrated into UniProtKB/Swiss-Prot. DT 05-JUL-2004, sequence version 1. DT 05-SEP-2012, entry version 71. FT COILED 59 140 ... (1 Reply)
Discussion started by: manigrover
1 Replies

6. Shell Programming and Scripting

Check Sequence

* Expiry DATE: * Address1: Address2: Address3: Address4: Address5: * PO_ref_number: aadad HolderId_1: HolderId_2: HolderId_3: HolderId_4: * adad: 00000 ada: 00000 adad: RANDOM adad: RANDOM ****************************** (4 Replies)
Discussion started by: arunshankar.c
4 Replies

7. OS X (Apple)

Check file sequence script not working. Need help.

I have a script to check a file sequence for missing frames. It used to work in true Unix but now on OSX 10.6.4 (bash) it reports every frame is missing. Hopefully someone here can help. #!/bin/csh -f if ($#argv < 1) then echo echo "Usage: checkseq <name> " echo... (3 Replies)
Discussion started by: scribling
3 Replies

8. Shell Programming and Scripting

Script to check file sequence

Hi everyone, I need help in creating a script that would check if the file sequence is in order in a particular directory. These are log files that are generated throughout the day. Example of the file name will be, ABC01_YYMMDDHHMM###### (ABC01_0904161829000001) Sometimes the file... (4 Replies)
Discussion started by: kumaran21
4 Replies

9. Shell Programming and Scripting

checking jump sequence number (part2)

The following script have some bug...can you all help me: #!/bin/sh start=1 for file_number in `ls -1 /appl/CH_DATA/archive/list1/CACHE/CDBACKUPFILEJohn*.archived | sort | cut -c 48,49,50,51` do if ; then # this is the first pass of the loop, so we've got nothing to compare start=0... (3 Replies)
Discussion started by: happyv
3 Replies

10. UNIX for Dummies Questions & Answers

Script in boot sequence

Hi , I have some problems with my library when the sytem boot : When HPUX is booting, HPUX and STAPE claim the drive initially. HPUX assigns an instance number. The instance number is tied to the hardware path. Near the end of the boot, the ATDD driver claims the drive from STAPE based... (1 Reply)
Discussion started by: delphine
1 Replies
Login or Register to Ask a Question