12-22-2011
Not all you tickets look like that, then. Only some of them have tags like MA-.
Of all that input data, what do you actually want out?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi,
i got a problem with understanding regular expressions. what i wanna do is
scanning the wtmp logfile for ips and if a specific ip is echoed id like to be a part of a text to be assigned to it.
the scanning is done with
#! /bin/bash
cat wtmp | strings | egrep -o "+\.+\.+\." | sort -u... (6 Replies)
Discussion started by: rocketkids
6 Replies
2. Shell Programming and Scripting
I have a simple file test.out that contains data in the form of
key1=A|shift1
key2=B|shift2
key3=C|shift3
and so on.
I need to get it to print
A
B
C
I can do it using lookbehind assertion such as this
( ?<==)()
yet I was wondering if there is another way of mutching single... (8 Replies)
Discussion started by: arushunter
8 Replies
3. Shell Programming and Scripting
Hi
I have a question on regex
There is a line in a script like
my_file="$(echo SunMonTueWed | sed "s//_&g") "
My question what does the expression _&g do.
Obviously in this example the output is
_Sun_Mon_Tue_Wed
Another question can i use some trick to get the result like... (3 Replies)
Discussion started by: xiamin
3 Replies
4. Shell Programming and Scripting
Hi, im sure this is really simple but i cant quite figure it out. how do i test against a word at the beginning of the line but up to the point of a delimiter i.e. ":"
for example if i wanted to test against the user in the /etc/passwd file
peter:x:101:100:peters account:/var/peter:/bin/sh
... (3 Replies)
Discussion started by: hcclnoodles
3 Replies
5. Shell Programming and Scripting
I have a basic question regarding * and . while using regex:
# echo 3 | grep ^*$
3
I think I understood why it outputs "3" here (because '*' matches zero or more of the previous character) but I don't understand the output of the following command:
# echo 3 | grep ^.$
#
I thought I... (7 Replies)
Discussion started by: mirage
7 Replies
6. UNIX for Dummies Questions & Answers
I have dates in mm/dd/yy format that I wish to convert to yy-mm-dd format.
()/()/() finds them, but when I try to replace with $3-$1-$2 both kate and kwrite treat it as a text literal. (2 Replies)
Discussion started by: porphyry5
2 Replies
7. Shell Programming and Scripting
Hi guys,
I have a file in the following format:
cmpr5551
cmpr6002
cmpr93
anne 5454
bbro 434
cmprsvc
cmprsvc7
ffgi55
vefe99
cmprsvc8
cmprsvc9
I need to "grep" only the entries which start with "cmpr" followed by the number. All other entries should be excluded.
I was trying to use... (3 Replies)
Discussion started by: aoussenko
3 Replies
8. Shell Programming and Scripting
Hi guys,
I am trying to "grep" or "egrep" the following entry out of the file using regex:
MACCDB1 or MACCDB2
The problem is that the file might contain other entries which start with "MACCDB" string.
I was trying to use regex to "grep" the exact pattern but it fails to output the correct... (2 Replies)
Discussion started by: aoussenko
2 Replies
9. Shell Programming and Scripting
Hi I am trying to match lines having following string
BIND dn="uid=
putting something like this is not working :
/\sBIND dn="uid=/
Any suggestion.
Thanks. John (9 Replies)
Discussion started by: john_prince
9 Replies
10. Shell Programming and Scripting
I want to match all occurrence of 01,03,05,07,10,11 at 9th and 10th position of a string .
I tried the following but its also matching characters like 33 or 11 on 9th and 10th position .
sed "/^\{8\}00/d" A.TXT
000000001000
433483433339 <<< wrong
121121211100 <<< wrong
167710000110... (10 Replies)
Discussion started by: boncuk
10 Replies
LEARN ABOUT DEBIAN
algorithm::checkdigits::m10_004
CheckDigits::M10_004(3pm) User Contributed Perl Documentation CheckDigits::M10_004(3pm)
NAME
CheckDigits::M10_004 - compute check digits for 2aus5, EAN, ILN, ISBN13, NVE
SYNOPSIS
use Algorithm::CheckDigits;
$ean = CheckDigits('ean');
if ($ean->is_valid('7622200004607')) {
# do something
}
$cn = $ean->complete('762220000460');
# $cn = '7622200004607'
$cd = $ean->checkdigit('7622200004607');
# $cd = '7'
$bn = $ean->basenumber('7622200004607');
# $bn = '762220000460'
DESCRIPTION
ALGORITHM
1. Beginning right all numbers are weighted alternatively 1 and 3 (that is the check digit is weighted 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.
To validate the total of the digits of all numbers inclusive check digit taken modulo 10 must be 0.
METHODS
is_valid($number)
Returns true only if $number consists solely of digits, spaces and hyphen 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, spaces and hyphen.
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.
BUGS AND LIMITATIONS
When invoked as "CheckDigits('isbn13')" the module checks whether the first three digits (the country code) are 978 or 979, the current (as
of 2006) EAN country codes for books. If at any time other EAN country codes for ISBN-13 will be specified and the then responsible
maintainer ignores this in the code, please send a friendly email.
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_004(3pm)