10-02-2010
Quote:
Originally Posted by
durden_tyler
(a) Remove all digits other than 0 from each number group. If you are left with three 0's (one from each group), then you have your answer.
(b) Repeat step (a) for the remaining 9 digits.
tyler_durden
what if i had a randomized function that would create random amounts of digits? I wouldn't be able to do it your way if thats how the digits are created in the first place... ( I should have mentioned that beforehand )
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have two files one (numbers file)contains the numbers(approximately 30000) and the other file(record file) contains the records(approximately 40000)which may or may not contain the numbers from that file.
I want to seperate the records which has the field 1=(any of the number from numbers... (15 Replies)
Discussion started by: Shiv@jad
15 Replies
2. Shell Programming and Scripting
I have a file with the following contents..say
123 abc 90and / 1009
from which i only need numbers to be printed.
like 123 90 1009
using any shell command.
Thanks. (7 Replies)
Discussion started by: vijay_0209
7 Replies
3. Shell Programming and Scripting
Howdy experts,
We have some ranges of number which belongs to particual group as below.
GroupNo StartRange EndRange
Group0125 935300 935399
Group2006 935400 935476
937430 937459
Group0324 935477 935549
... (6 Replies)
Discussion started by: thepurple
6 Replies
4. Shell Programming and Scripting
Help plz
Does any one have any idea how to compare interval ranges of 2 files.
finding 1-4 (1,2,3,4) of input2 in input1 of same key "a" values (5-10, 30-40, 45-60, 80-90, 100-120 ). Obviously 1-4 is not one of the range with in input1 a. so it should give out of range.
finding 30-33(31,32,33)... (1 Reply)
Discussion started by: repinementer
1 Replies
5. Shell Programming and Scripting
Hi everyone,
I must make a script which will be executed as follows :
./script.sh Directory/n.car where there can be as many numbers as we may want.
I'd like to : - ignore the Directory ; Meaning I just need n.car
- Check the name of the file : has it got some Alphabetic... (7 Replies)
Discussion started by: Lyth_o
7 Replies
6. UNIX for Dummies Questions & Answers
hey,
I have a file with numbers in US notation (1,000,000.00) as well as european notation (1.000.000,00)
i want all the numbers to be in european notation.
the numbers are in a text file, so to prevent that the regex also changes the commas in a sentence/text i thought of:
sed 's/,/\./'... (2 Replies)
Discussion started by: FOBoy
2 Replies
7. Shell Programming and Scripting
Hello All,
I am having problem to find what is the smallest number from 90% of highest numbers from all numbers in file. I am having file with thousands of lines and hundreds of columns.
I am familiar mainly with bash but I am open to whatever suggestion witch will lead to the solutions.
If I... (11 Replies)
Discussion started by: Apfik
11 Replies
8. UNIX for Dummies Questions & Answers
##### (0 Replies)
Discussion started by: lucasvs
0 Replies
9. Shell Programming and Scripting
Hi again. Sorry for all the questions — I've tried to do all this myself but I'm just not good enough yet, and the help I've received so far from bartus11 has been absolutely invaluable. Hopefully this will be the last bit of file manipulation I need to do.
I have a file which is formatted as... (4 Replies)
Discussion started by: crunchgargoyle
4 Replies
10. UNIX for Beginners Questions & Answers
Hi!
I found and then adapt the code for my pipeline...
awk -F"," -vOFS="," '{printf "%0.2f %0.f\n",$2,$4}' xxx > yyy
I add -F"," -vOFS="," (for input and output as csv file) and I change the columns and the number of decimal...
It works but I have also some problems... here my columns
... (7 Replies)
Discussion started by: echo manolis
7 Replies
LEARN ABOUT DEBIAN
algorithm::checkdigits::mxx_003
CheckDigits::MXX_003(3pm) User Contributed Perl Documentation CheckDigits::MXX_003(3pm)
NAME
CheckDigits::MXX_003 - compute check digits for DEM
SYNOPSIS
use Algorithm::CheckDigits;
$dem = CheckDigits('dem');
if ($dem->is_valid('GD0645027K1')) {
# do something
}
$cn = $dem->complete('GD0645027K');
# $cn = 'GD0645027K1'
$cd = $dem->checkdigit('GD0645027K1');
# $cd = '1'
$bn = $dem->basenumber('GD0645027K1');
# $bn = 'GD0645027K'
DESCRIPTION
ALGORITHM
The algorithm is a variation of the Verhoeff scheme.
0 All letters are changed to numbers.
1 All digits are permutated according to a permutation table.
2 The permutated digits are combined using a dieeder table. The first with the second, the result with the third, this result with the
fourth and so on.
3 The result of the last combination in the dieeder table is in such a way combined that the result is 0 (zero). The number used for this
combination is the checksum.
For details look at the source.
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>
THANKS
SEE ALSO
perl, CheckDigits, www.pruefziffernberechnung.de,
perl v5.10.0 2008-05-17 CheckDigits::MXX_003(3pm)