RavinderSingh13's awk solution above does not appear to work as is since $2 will be valued from a different column (e.g 30010)when the expected field is missing (as file is column delimited).
In open office spreadsheet, i would like to fill a cell with the name of the spread sheet.
That is if the file name of spread sheet is, team.ods, then i have to fill a specific cell with that name 'team'. How to do that ?
I have more spread sheets to be created, so i want it to be done... (0 Replies)
Greetings,
I have a hard time creating a large number of user profiles in a database.
The data file looks like this :
01/01/80 Mitch Conley
.
.
.
.
And I need to put the output into:
Name: Mitch
Surname: Conley
Birthday: 01/01/80
Thanks in advance! (3 Replies)
Hi All,
I have 100 files with names like this:
1.dat, 2.dat, 3.dat until 100.dat.
My dat files look like this:
42323 0
438939 1
434 0
0.9383
3434
120.23 3
234
As you can see in the second column, some numbers are missing. I want to fill those missing places with 0's in all... (3 Replies)
Hello,
I am fairly new to awk, and I have the following problem.
My file has missing data in the last column, and the program I am pre-processing this file for cannot interpret correctly shortened rows (it just wraps the data around).
Is there a way to force awk to create the same... (6 Replies)
hello everyone,
I have a task to input missing data into a file. example of my data below:
Wed Feb 01 09:00:02 EST 2012,,,0.4,0.3,,0.3,,0.3,,0.5,,0.3,,,0.4,0.3,
Wed Feb 01 09:00:11 EST 2012,,,,,,,0.2,,,,,,,,,,
Wed Feb 01 09:00:22 EST... (23 Replies)
Hello,
I need help for writing a script that fills already generated xml file with data from oracle database and random sequences.
For example if we have the following tags:
<ns1:message>
<ns1:messageId> </ns1:messageId>
<ns1:languageCode> </ns1:languageCode>... (10 Replies)
Hi
I want to get all numbers if number range is given as input.
Eg:
INPUT FILE
100-105
107
108-112
OUTPUT REQUIRED:
100 101 102 103 104 105
107
108 109 110 111 112
How can I do it using shell? :confused:
Thanks in advance. (11 Replies)
Dear Team
I need to insert field(which is need to taken from previous line's first field) in first column if its blank. I had tried using sed but not find the way. Detail input and output file as below.
Kindly help for same.
INPUT:
SCGR SC DEV DEV1 NUMDEV DCP ... (7 Replies)
I have a csv that looks like this:
,yude-to-nap2,0,0,0,0,0
,2twis-yude-to-nap2,0,0,0,0,0
,2tiws-yude-to-nap2,0,0,0,0,0
,2arcos-yude-to-nap2,0,0,0,0,0
and another file named m1 that has a single line of text as content:
Feb 1 15:30:20
How can I fill the whole the empty column of the... (1 Reply)
Hi,
I have the following content in file
ABBR DESC COL3 COL4 COL5 COL6
AAA text desc aaa text text text text
text text text text
text text text text
BBB text desc bbb text text text text
text text text text
CCC ... (10 Replies)
Discussion started by: bobbygsk
10 Replies
LEARN ABOUT DEBIAN
algorithm::checkdigits
CheckDigits(3pm) User Contributed Perl Documentation CheckDigits(3pm)NAME
Algorithm::CheckDigits - Perl extension to generate and test check digits
SYNOPSIS
perl -MAlgorithm::CheckDigits -e Algorithm::CheckDigits::print_methods
or
use Algorithm::CheckDigits;
@ml = Algorithm::CheckDigits->method_list();
$isbn = CheckDigits('ISBN');
if ($isbn->is_valid('3-930673-48-7')) {
# do something
}
$cn = $isbn->complete('3-930673-48'); # $cn = '3-930673-48-7'
$cd = $isbn->checkdigit('3-930673-48-7'); # $cd = '7'
$bn = $isbn->basenumber('3-930673-48-7'); # $bn = '3-930673-48'
ABSTRACT
This module provides a number of methods to test and generate check digits. For more information have a look at the web site
www.pruefziffernberechnung.de (german).
SUBROUTINES /METHODS
CheckDigits($method)
Returns an object of an appropriate Algorithm::CheckDigits class for the given algorithm.
Dies with an error message if called with an unknown algorithm.
See below for the available algorithms. Every object understands the following methods:
is_valid($number)
Returns true or false if $number contains/contains no valid check digit.
complete($number)
Returns a string representation of $number completed with the appropriate check digit.
checkdigit($number)
Extracts the check digit from $number if $number contains a valid check digit.
basenumber($number)
Extracts the basenumber from $number if $number contains a valid check digit.
Algorithm::CheckDigits::method_list()
Returns a list of known methods for check digit computation.
Algorithm::CheckDigits::print_methods()
Returns a list of known methods for check digit computation.
You may use the following to find out which methods your version of Algorithm::CheckDigits provides and where to look for further
information.
perl -MAlgorithm::CheckDigits -e Algorithm::CheckDigits::print_methods
CHECK SUM METHODS
At the moment these methods to compute check digits are provided: (vatrn - VAT Return Number, in german ustid UmsatzSTeuer-ID)
m07-001
See Algorithm::CheckDigits::M07_001.
euronote, m09-001
European bank notes, see Algorithm::CheckDigits::M09_001.
amex, bahncard, diners, discover, enroute, eurocard, happydigits, isin, jcb, klubkarstadt, mastercard, miles&more, visa, m09-001, imei,
imeisv
See Algorithm::CheckDigits::M10_001.
siren, siret, m10-002
See Algorithm::CheckDigits::M10_002.
ismn, m10-003
See Algorithm::CheckDigits::M10_003.
ean, iln, isbn13, nve, 2aus5, m10-004
See Algorithm::CheckDigits::M10_004.
identcode_dp, leitcode_dp, m10-005
See Algorithm::CheckDigits::M10_005.
rentenversicherung, m10-006
See Algorithm::CheckDigits::M10_006.
sedol, m10-008
See Algorithm::CheckDigits::M10_008.
betriebsnummer, m10-009
See Algorithm::CheckDigits::M10_009.
postscheckkonti, m10-010
See Algorithm::CheckDigits::M10_010.
ups, m10-011
See Algorithm::CheckDigits::M10_011.
hkid, isbn, issn, nhs_gb, ustid_pt, vat_sl, wagonnr_br, m11-001
See Algorithm::CheckDigits::M11_001.
pzn, m11-002
See Algorithm::CheckDigits::M11_002.
pkz, m11-003
See Algorithm::CheckDigits::M11_003.
cpf, titulo_eleitor, m11-004
See Algorithm::CheckDigits::M11_004.
ccc_es, m11-006
See Algorithm::CheckDigits::M11_006.
ustid_fi, vatrn_fi, m11-007
See Algorithm::CheckDigits::M11_007.
ustid_dk, vatrn_dk, m11-008
See Algorithm::CheckDigits::M11_008.
nric_sg, m11-009
See Algorithm::CheckDigits::M11_009.
ahv_ch, m11-010
See Algorithm::CheckDigits::M11_010.
ustid_nl, vatrn_nl, m11-011
See Algorithm::CheckDigits::M11_011.
bwpk_de, m11-012
See Algorithm::CheckDigits::M11_012.
ustid_gr, vatrn_gr, m11-013
See Algorithm::CheckDigits::M11_013.
esr5_ch, m11-015
See Algorithm::CheckDigits::M11_015.
ustid_pl, vatrn_pl, m11-016
See Algorithm::CheckDigits::M11_016.
ecno, ec-no, einecs, elincs, m11-017
See Algorithm::CheckDigits::M11_017.
isan, m16-001
See Algorithm::CheckDigits::M16_001.
dni_es, m23-001
See Algorithm::CheckDigits::M23_001.
ustid_ie, vatrn_ie, m23-002
See Algorithm::CheckDigits::M23_002.
code_39, m43-001
See Algorithm::CheckDigits::M43_001.
ustid_lu, vatrn_lu, m89-001
See Algorithm::CheckDigits::M89_001.
ustid_be, vatrn_be, m97-001
See Algorithm::CheckDigits::M97_001.
iban, m97-002
See Algorithm::CheckDigits::M97_002.
upc, mbase-001
See Algorithm::CheckDigits::MBase_001.
blutbeutel, bzue_de, ustid_de, vatrn_de, mbase-002
See Algorithm::CheckDigits::MBase_002.
sici, mbase-003
See Algorithm::CheckDigits::MBase_003.
pa_de, mxx-001
See Algorithm::CheckDigits::MXX_001.
cas, mxx-002
See Algorithm::CheckDigits::MXX_002.
dem, mxx-003
Old german bank notes (DEM), see Algorithm::CheckDigits::MXX_003.
ustid_at, vatrn_at, mxx-004
See Algorithm::CheckDigits::MXX_004.
esr9_ch, mxx-005
See Algorithm::CheckDigits::MXX_005.
verhoeff, mxx-006
Verhoeff scheme, see Algorithm::CheckDigits::MXX_006 or Algorithm::Verhoeff
EXPORT
None by default.
SEE ALSO
perl, www.pruefziffernberechnung.de.
AUTHOR
Mathias Weidner, <mathias@weidner.in-bad-schmiedeberg.de>
THANKS
Petri Oksanen made me aware that CheckDigits('IMEI') would invoke no test at all since there was no entry for this in the methods hash.
COPYRIGHT AND LICENSE
Copyright 2004-2006 by Mathias Weidner
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.0 2008-06-06 CheckDigits(3pm)