09-06-2010
Quote:
This
link might shade light explaining the difference between
a regexp constant and
a string constant
I ment that the escaping part is a mistery to me
(why does awk need so many backslashes?). I think I'm quite good with using regexes as well as understanding them
After taking a closer look at your link, I think it really did shade a little light on that escaping part of AWK. Thanks ;]
Last edited by bartus11; 09-06-2010 at 05:59 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there anyway to get awk to treat multiple delimiters as one? Particularly spaces... (6 Replies)
Discussion started by: peter.herlihy
6 Replies
2. Shell Programming and Scripting
Hi All
I have recently had to start using Unix for work and I have hit brick wall with this prob....
I have a file that goes a little something like this....
EUR;EUR;EUR:USD:USD;USD;;;EUR/USD;XAU/AUD;XAU/EUR;XAU/AUD,GBP/BOB,UAD/XAU;;;1.11;2.22;3.33;4.44;5.55;6.66;;;
is it possible to... (7 Replies)
Discussion started by: luckycharm
7 Replies
3. Shell Programming and Scripting
Hello,
I have data where words are separated by a delimiter. In this case "="
The number of delimiters in a line can vary from 4to 8. The norm is 4.
Is it possible to have a script where the file could be separated starting with highest number of delimiters and ending with the lowest
An... (8 Replies)
Discussion started by: gimley
8 Replies
4. Shell Programming and Scripting
Hello
If you wanted to sort a .csv file that was filled with lines like this:
<Ticker>,<Date as YYYYMMDD>,<Time as H:M:S>,<Volume>,<Corr>
(H : , M, S: )
by date, does anybody know of a better solution than to turn the 3rd and 4th colons of every line into commas, sorting on four keys,... (20 Replies)
Discussion started by: Ryan.
20 Replies
5. Shell Programming and Scripting
I have a file having lines like:
14: <a="b" val="c"/>
18: <a="x" val="d"/>
54: <a="b" val="c"/>
58: <a="x" val="e"/>
I need to create a file with output:
14
d
54
e
So basically, for every odd line I need 1st word if delimiter is ':' and for every even... (14 Replies)
Discussion started by: shekhar2010us
14 Replies
6. Shell Programming and Scripting
Hi, I need to display the last column value in the below o/p.
sam2 PS 03/10/11 0 441
Unable to get o/p with this awk code
awk -F"+" '{ print $4 }' pwdchk.txt
I need to display 441(in this eg.) and also accept it as a variable to treat it with if condition and take a decision.... (1 Reply)
Discussion started by: sam_bd
1 Replies
7. Shell Programming and Scripting
Hi Folks,
This is the first time I ever encountered this situation
My input file is of this kind
cat input.txt
1 PAIXAF 0 1 1 -9 0 0 0 1 2 0 2 1 2 1
7 PAIXEM 0 7 1 -9 1 0 2 0 1 2 2 1 0 2
9 PAKZXY 0 2 1 -9 2 0 1 1 1 0 1 2 0 1
Till the sixth column (which is -9), I want my columns to... (4 Replies)
Discussion started by: jacobs.smith
4 Replies
8. Shell Programming and Scripting
Hello all
I have a data base of information that is formatted like so:
JSD4863 XXX-XX-XXXX DOE, JOHN C JR-II BISS CPSC BS INFO TECH 412/779-9445
I need the last four digits of the phone number. However, many lines contain
'garbage data' that I'm not interested in. So i used a 'for loop'... (7 Replies)
Discussion started by: smartSometimes
7 Replies
9. UNIX for Beginners Questions & Answers
HI All,
How to append the multiple delimiters to at end the file up to 69 fields.
FinalDelimiter Count is 69
recrod Delimeter count is 10
so 69-10=59
this script will add upto 59 Delimiters to that records.
this script will check each and every record in a file and append the delimiters... (4 Replies)
Discussion started by: vinod.peddiredd
4 Replies
10. Shell Programming and Scripting
Hi All,
I have a file with a single row having the following text
ABC.ABC.ABC,Database,New123,DBNAME,F,ABC.ABC.ABC_APP,"@FUNCTION1("ENT1") ,@FUNCTION2("ENT2")",R,
I want an output in the following format
ABC.ABC.ABC DBNAME ABC.ABC.ABC_APP '@FUNCTION1("ENT1")... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
LEARN ABOUT DEBIAN
svn::hooks::denyfilenames
SVN::Hooks::DenyFilenames(3pm) User Contributed Perl Documentation SVN::Hooks::DenyFilenames(3pm)
NAME
SVN::Hooks::DenyFilenames - Deny some file names.
VERSION
version 1.19
SYNOPSIS
This SVN::Hooks plugin is used to disallow the addition of some file names.
It's active in the "pre-commit" hook.
It's configured by the following directives.
DENY_FILENAMES(REGEXP, [REGEXP => MESSAGE], ...)
This directive denies the addition of new files matching the Regexps passed as arguments. If any file or directory added in the commit
matches one of the specified Regexps the commit is aborted with an error message telling about every denied file.
The arguments may be compiled Regexps or two-element arrays consisting of a compiled Regexp and a specific error message. If a file matches
one of the lone Regexps an error message like this is produced:
DENY_FILENAMES: filename not allowed: filename
If a file matches a Regexp associated with an error message, the specified error message is substituted for the 'filename not allowed'
default.
Note that this directive specifies a default restriction. If there are any DENY_FILENAMES_PER_PATH directives (see below) being used, this
one is only used for files that don't match any specific rules there.
Example:
DENY_FILENAMES(
qr/.(doc|xls|ppt)$/i, # ODF only, please
[qr/.(exe|zip|jar)/i => 'No binaries, please!'],
);
DENY_FILENAMES_PER_PATH(REGEXP => REGEXP, REGEXP => [REGEXP => MESSAGE], ...)
This directive is more specific than the DENY_FILENAMES, because it allows one to specify different restrictions in different regions of
the repository tree.
Its arguments are a sequence of rules, each one consisting of a pair. The first element of each pair is a regular expression specifying
where in the repository this rule applies. It applies if any file being added matches the regexp. The second element specifies the
restrictions that should be imposed, just like the arguments to DENY_FILENAMES.
The first rule matching an added file is used to check it. The following rules aren't tried.
Only if no rules match a particular file will the restrictions defined by DENY_FILENAMES be imposed.
Example:
DENY_FILENAMES_PER_PATH(
qr:/src/: => [qr/[^w.-]/ => 'source files must be strict'],
qr:/doc/: => qr/[^ws.-]/i, # document files allow spaces too.
qr:/notes/: => qr/^$/, # notes directory allows anything.
);
AUTHOR
Gustavo L. de M. Chaves <gnustavo@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by CPqD.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-06-24 SVN::Hooks::DenyFilenames(3pm)