Hello All,
I have been searching and trying this for a bit now. Can use some assistance.
Large 5000 line flat file.
bash, rhel5
Input File Sinppet:
Fri Oct 30 09:24:02 EDT 2009 -- 1030
Fri Oct 30 09:26:01 EDT 2009 -- 73
Fri Oct 30 09:28:01 EDT 2009 -- 1220
Fri Oct 30 09:30:01 EDT... (9 Replies)
I'm using awk '{print $1}' and it works most of the time to print the contents of a mysql query loop, but occationally I get a field with some special character in it, is there a way to tell awk to ignore all special characters between my FS? I have >186K records, so building a list of ALL special... (6 Replies)
Hi,
i want to use awk to print the first 6 characters of a variable
awk -F"|" '$3>0 { print $3 }' z00.unl > z001.unl
but $3= 7 digits
and i just want to print the first 6 digits.
eg 1005779 but i want to print only 100577 (3 Replies)
Could someone please point me in the right direction with the following?
I have a program that generates logs that contains sections like this:
IMAGE INPUT
81 0 0.995 2449470 0 1726 368 1 0.0635 0.3291
82 0 1.001 2448013 0 1666 365 1 0.0649 ... (4 Replies)
Hi,
i need help to print only those numbers which occur next to each other from a file.
Input:
1
2
3
9
44
45
46
77
79
80
81
Desired Output: (8 Replies)
Hi Experts,
How to sepearate the list digit with letters : with a space from where the letters begins, or other words from where the digits ended.
file
52087mo(enbatl)
52049mo(enbatl)
52085mo(enbatl)
25051mo(enbatl)
The output should be looks like:
52087 mo(enbatl)
52049... (10 Replies)
I am trying to re-format a .csv file using awk. I have 6 fields in the .csv file. Some of the fields are enclosed in double quotes and contain comma's inside the quotes. awk is breaking this into multiple fields.
Sample lines from the .csv file:
Device Name,Personnel,Date,Solution... (1 Reply)
I have the following script that will print column 4 ("25") when column 1 contains "123". However, I need to ignore the alpha characters that are contained in the input file. If I were to ignore the characters my output would be column 3.
What is the best way to print my column of interest... (3 Replies)
Hi
Does anyone know of an efficient way to index a column of data in file2 to print the coresponding row in file1 which corresponds to the data in file2 AND 30 rows preceding and after the row in file1.
For example suppose you have a list of numbers in file2 (single column) as follows:... (6 Replies)
Discussion started by: Geneanalyst
6 Replies
LEARN ABOUT DEBIAN
algorithm::checkdigits::m11_001
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)