I am writing a script to search PCL output and append more PCL data to the end accordingly.
I need to remove the last 88 bytes from the string.
I have searched for a few hours now and am coming up with nothing. I can't use head or tail because the PCL output is all on one line. awk crashes on... (3 Replies)
Hi,
I have file as shown below.
abc,
def,
abc,
xyz,
I have to remove ',' from end of last line (xyz,). How can I do that with single command? Is it possible or I have to iterate through complete file to remove that?
- Malay (2 Replies)
I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed).
AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC
MY * A02 RESALE 6990788000 Y... (3 Replies)
Hello Friends, How can I remove the last two values of this line using sed
John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638:9/3/90:45900
The result should look like this:
John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638 (3 Replies)
All:
Can somebody help me out with a sed command, which removes the the first occurance of ')' until the end of the line
If I have the following input
... (5 Replies)
Hi all,
using VI, can anyone tell me how to add some characters onto the end of a line where the line begins with certain charactars eg
a,b,c,.......,
r,s,t,........,
a,b,c,.......,
all lines in the above example starting with a,b,c, I want to add an x at the end of the line so the... (6 Replies)
Hello,
I have records like below that I want to remove any five characters from the end of the string before the double quotes unless it is only an asterik.
3919,5020 ,04/17/2012,0000000000006601.43,,0000000000000000.00,, 132, 251219,"*"
1668,0125 ... (2 Replies)
How can I specify special meaning characters like ^ or $ inside a regex range. e.g
Suppose I want to search for a string that either starts with '|' character or begins with start-of-line character.
I tried the following but it does not work:
sed 's/\(\)/<do something here>/g' file1
... (3 Replies)
Hello.
The token is any printable characters between 2 " .
The token is unknown, but we know that it is between 2 "
Tok 1 : "1234x567"
Tok 2 : "A3b6+None"
Tok 3 : "A3b6!1234=@"
The ligne is :
Line 1 :
"9876xABCDE"Do you have any code fragments or data samples in your post
Line 2 : ... (3 Replies)
Perl::Critic::Policy::RegularExpressions::ProhibitUnusedUseruContributed Perl Perl::Critic::Policy::RegularExpressions::ProhibitUnusedCapture(3pm)NAME
Perl::Critic::Policy::RegularExpressions::ProhibitUnusedCapture - Only use a capturing group if you plan to use the captured value.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
Perl regular expressions have multiple types of grouping syntax. The basic parentheses (e.g. "m/(foo)/") captures into the magic variable
$1. Non-capturing groups (e.g. "m/(?:foo)/" are useful because they have better runtime performance and do not copy strings to the magic
global capture variables.
It's also easier on the maintenance programmer if you consistently use capturing vs. non-capturing groups, because that programmer can tell
more easily which regexps can be refactored without breaking surrounding code which may use the captured values.
CONFIGURATION
This Policy is not configurable except for the standard options.
CAVEATS
"qr//" interpolation
This policy can be confused by interpolation of "qr//" elements, but those are always false negatives. For example:
my $foo_re = qr/(foo)/;
my ($foo) = m/$foo_re (bar)/x;
A human can tell that this should be a violation because there are two captures but only the first capture is used, not the second. The
policy only notices that there is one capture in the regexp and remains happy.
"@-", "@+", $LAST_MATCH_START and $LAST_MATCH_END
This policy will only recognize capture groups referred to by these variables if the use is subscripted by a literal integer.
$^N and $LAST_SUBMATCH_RESULT
This policy will not recognize capture groups referred to only by these variables, because there is in general no way by static analysis to
determine which capture group is referred to. For example,
m/ (?: (A[[:alpha:]]+) | (Nd+) ) (?{$foo=$^N}) /smx
makes use of the first capture group if it matches, or the second capture group if the first does not match but the second does.
CREDITS
Initial development of this policy was supported by a grant from the Perl Foundation.
AUTHOR
Chris Dolan <cdolan@cpan.org>
COPYRIGHT
Copyright (c) 2007-2011 Chris Dolan. Many 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.14.22012-06-07Perl::Critic::Policy::RegularExpressions::ProhibitUnusedCapture(3pm)