Sponsored Content
Full Discussion: sequence number checking
Top Forums UNIX for Dummies Questions & Answers sequence number checking Post 35655 by nhatch on Thursday 24th of April 2003 01:42:19 PM
Old 04-24-2003
sequence number checking

Hi there,

I'm wanting to produce a shell script that will check through some file names and identify a skip in sequence (four digit seq num in file name).

I have played on the idea of havng a file that has a sorted list of file names which I can read line at a time and cut out the sequence number. This is were I'm sure where to go. How can I compare the current seqence number with the next?

I can get the current sequence number and produce what the next should be but how do I confirm what does come next?

I hope someone can help????

Cheers and beers,
Neil

PS, Not home work... and no, this not a double bluff!!!!
 

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

Unix script for Checking sequence

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 .... (2 Replies)
Discussion started by: Rata_raj
2 Replies

3. Shell Programming and Scripting

Changing the sequence number

Hi, I have a data as follow: 1 400 2 239 3 871 4 219 5 543 6 ... 7 ... .. ... .. ... 99 818 100 991 I want to replace the sequence number (column 1) that start from 150. The output should like this: 150 400 151 239 (3 Replies)
Discussion started by: nica
3 Replies

4. Shell Programming and Scripting

First number sequence from string

Hi, I have a string like: DBMS stats (Number Used | Percentage of total): 10 | 1.00% I have a sed command to extract numbers from this string: sed "s///g;s/^$/-1/;" Output: 10100 However what I want the sed command to return is only the first number(regardless of its size) i.e.... (3 Replies)
Discussion started by: mccartj5
3 Replies

5. Shell Programming and Scripting

Perl : print the sequence number without missing number

Dear Perl users, I need your help to solve my problem below. I want to print the sequence number without missing number within the range. E.g. my sequence number : 1 2 3 4 5 6 7 8 11 12 13 14 my desired output: 1 -8 , 11-14 my code below but still problem with the result: 1 - 14 1 -... (2 Replies)
Discussion started by: mandai
2 Replies

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

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

8. UNIX for Advanced & Expert Users

Checking missing data's sequence (shell script | UNIX command)

Dear All members, i have some trouble here, i want to ask your help. The case is: I have some data, it's like: -ABCD1234 -ABCD1235 -ABCD1237 -BCDE1111 -BCDE1112 -BCDE1114 there is some missing data's sequence (the format is: ABCD = name 1234 = sequence). I want to print the... (2 Replies)
Discussion started by: septian.tri
2 Replies

9. Shell Programming and Scripting

Hex number sequence help

Need some help doing this ... with awk maybe Input 0DF6 0DF7 0DF8 0DF9 0DFA 0DFB 0DFC 0DFD 0DFF 0E00 0E01 0E02 0E03 0E04 0E05 0E06 (11 Replies)
Discussion started by: greycells
11 Replies

10. Shell Programming and Scripting

Need append sequence number

Hi, Need to add sequnce number to one of the csv file and please find below actual requirement. Input file ABC,500 XXQ,700 ADF,400, ART,200 Out put file should be 1,ABC,500 2,XXQ,700 3,ADF,400, 4,ART,200 (3 Replies)
Discussion started by: siva83
3 Replies
CheckDigits::M11_001(3pm)				User Contributed Perl Documentation				 CheckDigits::M11_001(3pm)

NAME
CheckDigits::M11_001 - compute check digits for ISBN, ISSN, VAT RN (PT), HKID (HK), Wagon number (BR), NHS (GB), VAT (SL) SYNOPSIS
use Algorithm::CheckDigits; $isbn = CheckDigits('isbn'); if ($isbn->is_valid('3-88229-192-3')) { # do something } $cn = $isbn->complete('3-88229-192-'); # $cn = '3-88229-192-3' $cd = $isbn->checkdigit('3-88229-192-3'); # $cd = '3' $bn = $isbn->basenumber('3-88229-192-3'); # $bn = '3-88229-192-' DESCRIPTION
ALGORITHM 1. The sequence of digits is processed right to left. Every digit is multiplied with their position in the sequence (i.e. the digit left to the check digit has the weight 2 then 3 etc.). With a Hongkong ID (hkid) the leftmost char is replaced with its position in the alphabet and then multiplied with 8 (its weight). 2. The sum of all products is computed. 3. The sum of step 2 is taken modulo 11. 4. The checkdigit is the difference of the sum from step 3 to eleven under the following conditions: isbn,issn If the difference is 10, the check digit is 'X'. If the difference is 11, the check digit is 0. ustid_pt If the difference is greater then 9, the check digit is '0'. hkid If the difference is 10, the check digit is 'A'. If the difference is 11, the check digit is 0. wagonnr_br If the difference is 10, the check digit is 0. If the difference is 11, the check digit is 1. nhs_gb If the difference is 10, the number would not be taken. If the difference is 11, the check digit is 0. vat_sl This is a little bit unclear, don't trust on the method for this type. METHODS is_valid($number) Returns true only if $number consists solely of numbers and the last digit is a valid check digit according to the algorithm given above. Returns false otherwise, complete($number) The check digit for $number is computed and concatenated to the end of $number. Returns the complete number with check digit or '' if $number does not consist solely of digits and spaces. basenumber($number) Returns the basenumber of $number if $number has a valid check digit. Return '' otherwise. checkdigit($number) Returns the checkdigit of $number if $number has a valid check digit. Return '' otherwise. EXPORT None by default. AUTHOR
Mathias Weidner, <mathias@weidner.in-bad-schmiedeberg.de> SEE ALSO
perl, CheckDigits, www.pruefziffernberechnung.de. perl v5.10.0 2008-05-17 CheckDigits::M11_001(3pm)
All times are GMT -4. The time now is 02:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy