algorithm::checkdigits::m10_003(3pm) [debian man page]
CheckDigits::M10_003(3pm) User Contributed Perl Documentation CheckDigits::M10_003(3pm)NAME
CheckDigits::M10_003 - compute check digits for ISMN
SYNOPSIS
use Algorithm::CheckDigits;
$ismn = CheckDigits('ismn');
if ($ismn->is_valid('M-345-24680-5')) {
# do something
}
$cn = $ismn->complete('M-345-24680');
# $cn = 'M-345-24680-5'
$cd = $ismn->checkdigit('M-345-24680-5');
# $cd = '5'
$bn = $ismn->basenumber('M-345-24680-5');
# $bn = 'M-345-24680'
DESCRIPTION
ALGORITHM
1. The 'M' as the first number gets the value 3. Beginning left all numbers are weighted alternatively 3 and 1.
2. The sum of all products is computed.
3. The sum of step 3 ist taken modulo 10.
4. The check digit is the difference between 10 and the number from step 3 taken modulo 10.
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::M10_003(3pm)
Check Out this Related Man Page
CheckDigits::M10_006(3pm) User Contributed Perl Documentation CheckDigits::M10_006(3pm)NAME
CheckDigits::M10_006 - compute check digits for Rentenversicherung (DE)
SYNOPSIS
use Algorithm::CheckDigits;
$rv = CheckDigits('rentenversicherung');
if ($rv->is_valid('65180539W001')) {
# do something
}
$cn = $rv->complete('65180539W00');
# $cn = '65180539W001'
$cd = $rv->checkdigit('65180539W001');
# $cd = '1'
$bn = $rv->basenumber('65180539W001');
# $bn = '65180539W00'
DESCRIPTION
ALGORITHM
1. The letter is replaced with a two-figure number appropriate to the position of the letter in the german alphabet.
2. Beginning left all numbers are weighted with 2,1,2,5,7,1,2,1,2,1,2,1.
3. The the total of the digits of all products is computed.
4. The check digit is sum from step 3 taken modulo 10.
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::M10_006(3pm)
I've refined the filesystem size using awk and directed to a file name.
eg, here's the content in a file called "numbers"
$cat numbers
345
543
23423456
44435
546
.
.
how do you write a script to all these numbers to get the total?
thanks a lot. (9 Replies)
Hello..
I have got one file ...
I want to add line numbers with space form starting to ending..
for example...if the file is
--------------------------
sand sorcd 2345 345
recds 234 234 5687
yeres 568 988 erfg4 67
--------------------------
I need the output
... (4 Replies)
Hi Friends,
How i can get the sum of the coloumn value and assign to variable.
a1 a2
233 123
234 345
235 254
i need to get the sum of the to columns and assign to a variable.
sum1= {.....}
sum2={....}
thanks
Nayanajith. (4 Replies)
Hi Friends,
I have some problem in replacing a string which is enclosed between $ signs. Please see below:
I am trying to replace the string ($str1_str2_str3_str4$) with 12.345.65.234 but no luck...
I am using the following command for this but it's not doing anything, if I take out the second... (4 Replies)
Hi
Suppose we have a file consisting of nos in following format
123 - 789
123 - 828
345 - 989
345 - 792
I require the following output
123, 789,828
345, 989,792
Means Unique nos in 1st Column and Corresponding two nos in comma separated 2nd Column
Please help me out... (6 Replies)
Hi all,
I need to extract the Particular string from the whole word,the input file is :
123,345,aaaa,555,....,....
I need all the record from 345 so i need to eliminate the first record.
Output:
345,aaa,5555,....,.....,.....
Thanks in advance. (3 Replies)
It seems that I really need some serious regexp study, in the following example,
>cat /tmp/test
abc 7878 7878 7878 7878 123 123 123 345 234 345 345 345 345
>sed 's/\(* \)*/\1/g' /tmp/test
345 345
Why sed deletes all the columns except the last two ones? From what I understood, sed... (1 Reply)
Awk Array doesnt match for substring
nawk -F"," 'FNR==NR{a=$2 OFS $3;next} a{print $1,$2,a}' OFS="," file1 file2
I want cluster3 in file1 to match with cluster3int in file2
output getting:
Output required:
Help is appreciated (8 Replies)
I had a requirement in which in need to pan(*) out digits except the first six visible, followed by six *, and rest
visible of a variable(input)
ex:
Input - 123456789012345
Output - 123456******345
ex:
Input - 1234567890123456
Output - 123456******3456
so i tried something like... (12 Replies)
Hi,
I have a file with data as given below
$cat file1
123|abc|345
345|def|567
The first record is good record. The second record has an invisible junk character like \032.
I was replace all the occurences of that invisible character with #.
I want to do this for a set of... (16 Replies)
Hi, Gurus,
I have a file like
1 234, 345, 456
2 345, 456, 345
I want to use awk with multipe separator ( one is comma, another is space)print out $1, $3 which should be:
1, 345
2, 456
but I don't know how to put space as separator with another separator.
Thanks in advance (7 Replies)
i have a file like below
New_file.txt
123|345|ab cd|ef gh
345|456|jk hu|uyh
My script is
#!/bin/ksh
set -x
for line in `cat New_file.txt`
do
a1=`echo $line|cut -d '|' -f1`
echo $a1
done
output
++ cat New_file.txt (2 Replies)
Dear Help,
I have an i/p file which looks like :
1 24 980
10 97 345
100 67 345
2 945 325
20 8 234
Is there a way to print it like, below format
1 24 980
10 97 345
100 67 345
2 945 325
20 8 234
Thx (3 Replies)