Yes, it does remove parentheses, but not the content in them.
Next time I should ask precisely.
Perhaps, but your output file specification was precise. I think Chubler_XL got it right, no?
Another way of writing it would be:
Note that the thing different from your original attempt is that the . is replaced by [^)] (to force lazy matching, rather than the standard greedy matching) and the - is specified, so it will be removed too.
Last edited by Scrutinizer; 02-09-2015 at 12:23 AM..
This User Gave Thanks to Scrutinizer For This Post:
Hi
I would like to replace a comma in parentheses to a semicolon for example. Other commas outside () stay unchanged. How can I do this?
aaaa,bbb,ccc,ddd(eee,fff,ggg),hhh,iii
to
aaaa,bbb,ccc,ddd(eee;fff;ggg),hhh,iii
Thanks (5 Replies)
hi, unix gurus.
i am wondering if someone can give me a clear explanation of the differneces between parentheses and brackets, both single and double.
i have heard that double parentheses (( are used for numerical expressions and that single brackets [ are used for strings. but i see... (1 Reply)
Hello,
Some time back I had posted a request for a syllable concordance in which if a syllable was provided in a file, the program would extract a word from a file entitled "Corpus" matching that syllable. The program was
The following script was provided which did the job and for which I am... (3 Replies)
I was looking at a script in my little book on bash and saw that one of the if statements had parentheses instead of brackets for the condition. I've been trying to find in my book where it talks about parentheses (because the examples on the if statement in an earlier chapter doesn't seem to... (3 Replies)
This is my input file:
a|b|c(ef)|g|h(km)|p
My output file should look like:
a|b|ef|g|km|p
That is, pipe is the delimiter. The data within pipe must be displayed as it is but if it encounters any data within parentheses, then only the data within parentheses has to be displayed ( the data... (2 Replies)
Suppose I have this code :
int main () { int i = NULL; /* incorrect */ return 0; }
and I want to put the word between the two parentheses
like this :
int main (void) { int i = NULL; /* incorrect */ return 0; }
which command is used to do it in Linux ? (2 Replies)
Hi, I have a big settings confg (file attached). There are a few separate tasks that I have to accomplish. All scripting/programming languages are appreciated.
1. I need to parse all values and output to stdout. Sample output (truncated):
VALUEA
2017-01-01
Lores ipsum
Lorem ipsum dolor sit... (11 Replies)
Dear community, I am facing a problem and I kindly ask your help:
I have 4 different data sets consisted from 3 different types of array.
On each file, column 1 is chromosome position, column 2 is SNP id etc... Lets say I have the following (bim) datasets:
x2014:
1 rs3094315... (4 Replies)
Perl::Critic::Policy::CodeLayout::ProhibitParensWithBuilUser(Contributed Perl DocumPerl::Critic::Policy::CodeLayout::ProhibitParensWithBuiltins(3)NAME
Perl::Critic::Policy::CodeLayout::ProhibitParensWithBuiltins - Write "open $handle, $path" instead of "open($handle, $path)".
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
Conway suggests that all built-in functions be called without parentheses around the argument list. This reduces visual clutter and
disambiguates built-in functions from user functions. Exceptions are made for "my", "local", and "our" which require parentheses when
called with multiple arguments.
open($handle, '>', $filename); #not ok
open $handle, '>', $filename; #ok
split(/$pattern/, @list); #not ok
split /$pattern/, @list; #ok
CONFIGURATION
This Policy is not configurable except for the standard options.
NOTES
Coding with parentheses can sometimes lead to verbose and awkward constructs, so I think the intent of Conway's guideline is to remove only
the unnecessary parentheses. This policy makes exceptions for some common situations where parentheses are usually required. However, you
may find other situations where the parentheses are necessary to enforce precedence, but they cause still violations. In those cases,
consider using the '## no critic' comments to silence Perl::Critic.
BUGS
Some builtin functions (particularly those that take a variable number of scalar arguments) should probably get parentheses. This policy
should be enhanced to allow the user to specify a list of builtins that are exempt from the policy.
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.16.3 2014-06-09 Perl::Critic::Policy::CodeLayout::ProhibitParensWithBuiltins(3)